score:0
you can render for both path same component:
<route exact path="/">
<pages/>
</route>
<route path="/recette/:id">
<pages/>
</route>
and use condition in component:
if(match.url.includes('recette') {
<recipedetailpage />
} else {
<homepage />
}
Source: stackoverflow.com
Related Query
- How to open a route in a separate component without unmounting the previous one in React JS?
- How to use nested routes to add content to a page without removing the content of the previous route with react-router-v4?
- how to update a route in React Router without re-mounting the component in a single page app?
- How to pass route parameters from one Component and display in the other
- How can i route my Home component from the code below without throwing uncaught TypeError in the console
- how do I use bootstrap in only one component in my react app without messing up the layout?
- How to pass one state the component father to component child to open a modal React
- React - How to Populate one DropDown based on previous DropDown without updating the second default field
- How to only update one element within a component without rerendering the whole component?
- How can I change the URL without rendering another component or redirecting to a different route in React?
- How can I modify the props of one child component from a separate child component?
- How to open react component in new tab without rendering the whole app component?
- how to pass just the function from one component to other component without passing the whole component or button click
- How to open page by it link as one html component inside my htlm page without leaving it?
- How to return to previous route using JavaScript without going back in the browser?
- How to Route without reloading the whole page?
- How to pass the match when using render in Route component from react router (v4)
- How to override styles for material-ui TextField component without using the MUIThemeProvider?
- How can I make the edit-mode field type of one material-table column dependent upon the value of another column, without affecting other rows?
- How to I keep a Material-ui Select open when I click on only one of the items in it
- How can I use one component (page) for multiple route in Next JS
- React : How to stop re-rendering component or making an API calls on router change for the same route
- How to change page title on separate header component depending on route with React?
- react-router: how to get the previous route in onEnter handler?
- How to link or route the react semantic UI dropdown component
- How to access route params from a component other then the Router component
- How to use Redux store in one component without Provider but with connect, because children aren't necessary?
- p5.js and React: how to update a sketch inside a component when one of the component's props is updated
- How to detect matched route from a component outside of the <Route/> component that was matched using react-router?
- How do I get the dom node of a child element in a component without adding logic to its parent/children?
More Query from same tag
- Passing a prop from a Parent component becomes null in the Child component React
- Can't select child-elements in chrome dev tools anymore when using an image overlay (card-img-overlay)
- How to have sub components CSS class react on parent components CSS class?
- How to prevent children component from rerendering?
- Redirect (react-router-dom) is not working in react class component
- Transition for moving objects with position: fixed?
- ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY on dotnet core 3.1 react project
- React Router NavLink not triggering history.listen() function
- why updated state not reflected inside an event listener: React Native, Hooks
- How do you know when to stop applying single responsibility principle in React components?
- Axios to Node (Express) GET Request
- reactjs map and css class toggle
- Clear Search value on focus out of a Multiselect - multiselect-react-dropdown (React JS)
- Trouble on testing onChange property from ant design
- How to concatenate values to be used in state in REACT
- How to update list in React setState() method?
- How to set up Typescript with a React state with an Object?
- Call a method into the class React ES6
- how to set value in react-select
- Applying Material UI styleOverrides at the component-level with styled()
- Input text in draft.js
- How can I display a populated document in react
- Each child in a list should have a unique "key" prop. How to know to use word "key" instead of "key2"
- How to use enum (attached to a class as a static variable) as a type
- React class old lifeCycle methods into hooks
- Set value of state to clicked button's value
- ReactJS KonvasJS How to create 2 layers that cannot overlaps
- Why do these two pieces of Hello World code differ in behaviour?
- Prefer default export eslint error
- Container props changing after state changes within children