So I have buttons with functions in them in my React JS app and if the user hits the button(for example: Save) I have them redirect to the home page using history.push("/home");
. This works good however it doesn't re-render my home page so none of the data that was updated is shown. I'm wondering how I can redirect to and re-render that home page when a user clicks on Save.
How to redirect to a page and re-render that page at the same time
276 views Asked by DDavis25 At
1
Try using React Router LINK
Then use it like this:
This will change the history.
You can also add
onClick
functions to it as well.