Skip to content
Advertisement

could not render component in react

When I use history.push () method, from signup to log in, goes to a particular API/URLenter code here but does not render the login component.

JavaScript

Advertisement

Answer

Do not create new history.
You can use useHistory that exported from react-router-dom instead and get the current history. It would be something like this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement