Component does not remount when route parameters change

If you do need a component remount when route changes, you can pass a unique key to your component’s key attribute (the key is associated with your path/route). So every time the route changes, the key will also change which triggers React component to unmount/remount. I got the idea from this answer

Leave a Comment