score:1
Accepted answer
Change
export default class OwnBrowserRouter extends BrowserRouter {
history
}
To
export default class OwnBrowserRouter extends BrowserRouter {
history = history;
}
As stated in the Class fields proposal, certain transpilers may ignore the field completely. Thus the original history (the one created in the original BrowserRouter) will be used.
Both public and private field declarations create a field in the instance, whether or not there's an initializer present. If there's no initializer, the field is set to undefined. This differs a bit from certain transpiler implementations, which would just entirely ignore a field declaration which has no initializer.
Source: stackoverflow.com
Related Query
- React router - page doesn't change when navigating from outside component
- how to catch react router change event from outside page
- How to pass the match when using render in Route component from react router (v4)
- how and when to call a react component methods after state change from redux
- Change the state when clicking outside a component in React
- CSS changes when navigating from and back to Page - React
- React Router "Link to" does not load new data when called from inside the same component
- How to prevent component from unmounting immediately when using React Router V4
- React router doesn't load page from other component page
- react router v4 redirecting to another page outside of component
- Get params from outside of route component in React Router 6
- Can't update React Component state when triggered from outside
- React Router Dom deletes vales when I change page
- React component doesn't change state when react router remounts it
- React router Redirect does not work when route comes from another component
- NextJS - can't identify where state change is occurring on page component when using shallow Router push
- How can i remove a Property from a react component on router path change
- want to go to SignUp page when clicked on SignUp from the App component in React can some one rectify the code accordingly
- react router dom is not updating class component when url change
- How do I tell React component to change its state when an event is triggered from third party lib?
- How to pass a prop from one component to another when using react router link
- React Redux: Reload the component from ACTION when the props change
- React doesnt rerender component when props value is being change
- How to stop react component from going past the top of the page when scrolling
- react router scroll to top when navigating to current page
- Display URL params on page when using react `withRouter` from react router dom
- Navigating Using React Router From a Button Outside the React App
- useEffect not running at all when navigating to page with React Router
- In react router when routing to another page it starts from the part where i left the previous page?
- How can I use React Router to change routes from within a component that is also Routed in the Main App.js component?
More Query from same tag
- How can I create multiple instances of a React component (having an infinite animation) with different values for the :root variables
- Change font size of dynamic table header using react
- Parent state undefined in componentDidMount event of the child component
- Render unique initials in a list
- Lose state in React Js
- React setState with arrays , how to auto create an array id without construct
- Problem with functional component typisation
- How to access the DOM element of the child component in Preact with hooks?
- What does the CssBaseline class do?
- React add array to state array
- React native and MobX: How to create a global store?
- Creat Range Slider in React.js
- Chat scroll to bottom when send a message using React
- Making my Toast component available to child components
- How often Service Worker refreshes?
- Minimize parameters for createSelector in reselect Reactjs
- How to get the current zoom of the map [getZoom()] in react-google-maps?
- How to use the useHook in the component rather than passing the value returned from it as a prop to the components using react and typescript?
- React: how to use onclick function in a loop in class component?
- How to find out if url domain match email domain
- Patching AutoComplete In React
- Idiomatic React for Blueprintjs Toast component
- how to sort an array by string and number and date property using reactjs?
- Is there a valid way to use redux with react without react-redux?
- MUI Autocomplete remove option after selection
- Recharts Treemap Tooltip label
- How to individual update checkbox in antd checkbox group
- mapStateToProps ownProps params are empty
- Installing npm package from fork with yarn + webpack - Can't resolve './dist/
- ReactJS fetching new data on prop