'How to rerender page I am at in React Router 6
How do I get the component to re-render when I click navigation to the same page I am at? I have a item handle page that I would like to rerender without any location state on pressing navigation tab to it.
Solution 1:[1]
One of the best react-router features is that navigating does rerender the page unlike raw HTML style with <a href="xxx" ></a>.
In react, rerenders are done when you change your state or change prop. That is the proper way how to rerender. But you can force rerender with this line this.forceUpdate() but it is not recommended to do it this way. So choose whatever you like the most
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | OndrejHj04 |
