When a button is clicked, How should I route in React to an unknown url?

Sorry if the second part of the question is not very accurate. I didn´t have the space in the title to describe it. What I mean with an “unknown url” is that it is a url that the program won´t know it until the the user makes certain actions in the web.

I´ll explain myself shortly. I am trying to build a todo list. But it is a todo list that each time a user creates a new one, it will generate an unique ID for that list so that list can be accesed from anywhere. For example:

User creates the list “shopping list”.A POST request is made and Under the hood my backend generates an unique id. Let´s call this id “ghf6502”

A GET route it´s ready for “www.myweb.com/list/:id”.

The problem is now thinking about how i should implement this in the front end (i´m using React). Because if i try to do it via the normal static web approach with React Router, then I am not sure if it would be ideal since the page would have to wait to generate this GET route).

Well, basically I am very confused in how to do this. Any advice will be appreciated.