score:0
you should try wrapping the route
components with a switch
<browserrouter>
<route render={
({ location }) => (
<reactcsstransitiongroup
transitionentertimeout={300}
transitionleavetimeout={300}
transitionname="fade">
<switch key={location.key}>
<route
component={loginview}
exact
key="l"
location={location}
path="/" />
<route
component={underconstructionview}
exact
key="uc"
location={location}
path="/under-construction" />
</switch>
</reactcsstransitiongroup>
)
}
/>
</browserrouter>
Source: stackoverflow.com
Related Query
- How to implement animations using react router 4
- How to implement authenticated routes in React Router 4?
- How to mock history.push with the new React Router Hooks using Jest
- How to use React Router on top of Rails router (not using react-rails gem)?
- How to pass params into link using React router v6?
- How can we implement componentWillUnmount using react hooks?
- How can I pass data using <Redirect> in react router v4?
- React Router V4 Implement NavLink inside a ListItem using Material UI
- Using React Router and Webpack 2 how to require external libraries only on certain routes?
- How to implement multiple checkbox using react hook
- How to pass the match when using render in Route component from react router (v4)
- How to use Apollo Client + React Router to implement private routes and redirection based on user status?
- How to implement scroll restoration for React Router SPA
- How to implement navbar using react
- how to pass props to the route when using react router <Link>
- How do you pass data when using the navigate function in react router v6
- How we can convert client side rendering react js app to server side rendering using react router 4?
- How to pass data from a page to another page using react router
- How to detect route changes using React Router in React?
- How to refer to data with permalinks using react router
- I can not get the state from react router Link component using useLocation. So how can I pass it?
- How to intercept back button in a React SPA using function components and React Router v5
- How to redirect to not found page if slug doesn't exist using React Router Dom?
- how to get params using react router dom v5.0.1
- How to fix blank screen when using react router in redux
- How to prevent component from unmounting immediately when using React Router V4
- How to Handle Redirecting to the Same Route (with Query Params) Using React Router v4
- How to track page views in react using reach router and google analytics?
- how to show details page using react router dom
- How to implement a react controlled input using useReducer?
More Query from same tag
- How can I send an audio reference to a function in React?
- Webpack css setup and best practise
- @blueprintjs/table how to navigate using arrow/tab keys
- Generics that extend a static type aren't intellisensing
- React - change state right after previous state change was rendered
- Navigating between multiple params - React js
- Using two redux actions when clicking a button
- How to pass data between the function App() parent and the Material-UI nested sidebar child
- How to spy on a method which is called inside componentDidMount
- Re-render Reactjs components for print
- React Router v4 replace history when component is unmounted
- Generalizing function to reuse with different elements
- How to dispatch multiple actions one after another
- Difference between google-map-react and google-maps-react?
- How does one make an image path fetched from mongodb work in react project?
- Webpack / Babel Error: Module build failed: (SystemJS) ENOENT: "object-assign"
- Render PDF in React using PDF-LIB
- How can I pass React props in audio player?
- Style the last element of dropdown menu React Native
- How to make Radio buttons of the same Radio group align in several columns in Material UI?
- Getting 400 Error When Uploading PDF File
- How to pass state from one component to another in React js?
- How a React component is able to access props not passed to that component?
- redirect to same component under different conditions?
- React JS state not updating
- React: make a cycle-through component with both forward and backward directions using Generator
- Testing for a button's disabled state in React
- Dinamically loading images with require in React has different behaviors
- Ant design fixed side menu issue
- Why does state not update as expected?