score:1
Accepted answer
Try rearrange the order of your route and also add exact
also in your code path='companies/:slug/forms' is missing a /
<Route exact path='/companies/:slug/forms' exact component={Forms}></Route>
<Route
exact
path='/companies/:slug'
render={(props) => <CompanyDetails {...props} isAuthed={true} />}
/>
If above doesn't work, try add /
to your link in CompanyDetails page
<Link to={`/${this.props.match.params.slug}/forms`}>
Source: stackoverflow.com
Related Query
- Multiple params with React Router change url but not component
- Reactjs - changing url using react router but the component does not change
- React router 4 - Why is my component only rendered on manually setting the url but not on clicking a Link with same url?
- React Router multiple params in url not navigating to component
- URL changes with React Router but component not rendering?
- React router does not change view, but url is changed - App is load inside iframe
- React Router useHistory. History.push changes url but does not load component
- React router not reloading Component when changing url params
- React 18 router changing url but not component
- React reach router link tag updates url but not the component
- ReactJS - React Router not changing component but url is changing
- React components not rendered on url change with React Router
- react router dom is not updating class component when url change
- React router history.push updates URL but doesn't update component when used with redux
- React Router Dom & Firebase Auth: history.push changes url but does not render new component when called after firebase auth create account
- React Router Link to same component with different URL not re-rendering
- Component not updating on state change with React Router
- URL changes but component is not render - React Router
- How to pass data to another component not in the URL with React Router
- React router receives match params but does not update the component
- React router changes url but not the component [SOLVED]
- how to debug react router not loading component on url change
- React Router - URL changes but not Component
- React Router url updates but component does not
- why react router url changes but component does not load in my nested router app
- My React Router Links are not working. It's showing the url change in the browser but contents are not showing
- React Router - passing Slug as a prop to child Component and not getting params of url
- React router changes the url but not reload the component
- I am having an issue with react router as my url is getting updated on clicking on it but the page is not getting rendered
- React router url changes correctly but component not being rendered from button component link
More Query from same tag
- How to Open React Native Expo Camera On Button Click
- ReactJS Child Component Not Updating When Props Changes
- Reactjs Grid layout with defined number of columns
- Why this is undefined in React?
- Getting error when npm start with React application
- How should I trigger an XHR on component MouseClick using CalmmJS and React?
- Adding background to div using props
- How do I resize the width of <Input> element in Reactstrap?
- How to store object In Cookie in React using Hooks
- Handling checkboxes with nested array of objects
- Dynamically changing number of columns in React Native Flat List
- How to render accents in ReactJs?
- TypeError: document.getElementById(...) is null; in react using axios
- Do I have to save react component files with a jsx extension
- download image in react
- I cant get Redux action to work there is some error I cant spot please advice
- How to simulate event of barcode scanning
- Inline editing in fixed data table 2
- I have scanned qrcode using React. It shows the result. My code is OK. But I want to save the result in a variable. How can I do it using react?
- Navlink - React Router Dom not working in React.Js
- get promise value in react component
- React Jest Testing onSubmit
- How to delete an item from a table in 'React' using 'Redux'
- How do you use react-router-dom to redirect user when token has expired?
- How access root element in ReactJS?
- React - Change icon when click on a list element
- Filtering an ag-grid based on selected row in another ag-grid
- React Js : Handle Nested Element In State
- React button: how to make it change onClick
- Actions must be plain objects while using redux-thunk