DEV Community

loading...

Discussion on: React Router - Route ( WTF Moment )

Collapse
limxingzhi profile image
XING • Edited

For anyone curious, this is the documentation for the specific mounting behavior mentioned by the author : reactrouter.com/web/api/Route/rend...

Which kinda makes sense doesn’t it. React aside, typical web based routing that serves different HTML pages based on the URL will definitely not retain your local state between routes unless you implement some sort of store or caching solution. The routing behavior of unmounting a component when the URL changes sort of fits into that narrative.

I am curious though, did you notice any performance difference between using the render prop VS the child node?

Edit: store or caching solution

Collapse
scorreaui profile image
Santiago Correa Author

Hi there,

No i didn’t really notice any performance improvements between using component and render

Forem Open with the Forem app