Answer the question
In order to leave comments, you need to log in
How not to render a component when the URL changes?
Hello everyone
, I have a MainView component in it there are two components NavHomes and NavRooms,
when you click on a house or room, the url changes (for example: /homes/10/rooms/5) when the url changes, the entire MainView page is redrawn, respectively, and both components with navigation. How can I make it so that if only the room changes, NavHomes doesn't render?
here are the react-router-dom routes.
{path: '/homes/:homeId', exact: true, component: MainView},
{path: '/homes/:homeId/rooms/:roomId', exact: true, component: MainView},
upd:
navigation component Swiper react component was made at home, the problem is that when rendering, the swiper constantly returns to the beginning, and I need it to always be in the zone of the active element
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question