4

We have an expensive to render component that we use as a route in react-router 4.

When navigating away from it and then returning to it, it is recreated and rendered. I would like to cache/hide-unhide it instead of recreating it (avoid mount/unmount).

Is there built in support for this in react-router?

Note we use the new react-router-dom.

Thanks

1
  • It was easy with React Router 3, we use cache and hide rendered components and then display the same on POP action of browser history. But in React Router 4, same approach is not working any more. Any thoughts?
    – AjayK
    Jun 6, 2017 at 12:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.