DEV Community

Discussion on: An alternative to handle state in React: the URL !

Collapse
 
jacobmoyle profile image
Jacob

Regarding point #2:
History.replaceState(...) may solve your problem:

The History.replaceState() method modifies the current history entry, replacing it with the stateObj, title, and URL passed in the method parameters. This method is particularly useful when you want to update the state object or URL of the current history entry in response to some user action.