davidmfoley / react-router-modal

Simple modals for react-router 4
MIT License
153 stars 20 forks source link

How to ONLY render the modal and not RE-RENDER the route behind the modal #65

Open JeremyColton opened 3 years ago

JeremyColton commented 3 years ago

Hi,

You wrote in your main doc page: 'To display a modal component "on top" of another component, both routes (the ModalRoute and the Route that renders the other component) must match.'

The downside is that when the modal is opened, the parent route's components are re-rendered which is a waste and slows down the modal's rendering! My parent route loads a heavy menu page. How can I stop the parent from re-rendering AND open the modal which has its own route?