score:0
this is the correct link to react-router-redux v4 example. you have to use connectedrouter
from react-router-redux and pass history
. i configured my project yesterday based on this example and it works fine.
score:0
in react router v4, your configuration should be something like below.
import { browserrouter, route, switch } from 'react-router-dom';
<provider store={createstorewithmiddleware(reducers)}>
<browserrouter>
<div>
<switch>
<route path="/api/:id" component={componentone} />
<route path="/" component={home} />
</switch>
</div>
</browserrouter>
</provider>
the api has been changed since the previous version. also note that the order matters. keep the most specific paths at the top.
score:0
in my project, i get rid of this type of error in two steps:
step in to import import createbrowserhistory from 'history/createbrowserhistory'; and declaring const customhistory = createbrowserhistory(); like this:
import { browserrouter as staticrouter, router, switch, route, link } from 'react-router-dom'; import createbrowserhistory from 'history/createbrowserhistory'; const customhistory = createbrowserhistory();
it looks like that it is necessary to add history attribute to the router:
<router history={customhistory}> <div> <link to={'/.../' + linkname1}> {itemname1} </link> <link to={'/.../' + linkname2}> {itemname2} </link> </div>
Source: stackoverflow.com
Related Query
- Failed prop type The prop is marked as required but its value is `undefined`
- The prop `history` is marked as required in `Router`, but its value is `undefined`. in Router
- Warning: Failed prop type: The prop `store` is marked as required in `Provider`, but its value is `undefined`. in Provider
- Warning: Failed prop type: The prop `to` is marked as required in `Link`, but its value is `undefined`
- Warning: Failed prop type: The prop open is marked as required in Snackbar, but its value is undefined
- Failed prop type: The prop `userSignUpRequest` is marked as required in `Login`, but its value is `undefined`
- reactjs Delete Operation Warning: Failed prop type: The prop `role` is marked as required in `ManageRolePage`, but its value is `null`
- Failed prop type: The prop `value` is marked as required in `Rating`, but its value is `undefined`
- Failed prop type: The prop todos[0].id is marked as required in TodoList, but its value is undefined
- Warning: Failed prop type: The prop `value` is marked as required in `TextInput`, but its value is `undefined`
- Warning: Failed prop type: The prop `theme` is marked as required in `MuiThemeProviderOld`, but its value is `undefined`
- Using GatsbyImage - I keep getting an error Failed prop type: The prop `image` is marked as required in `GatsbyImage`, but its value is `undefined`
- Warning: Failed prop type: The prop `term` is marked as required in `ParentComponent`, but its value is `undefined`
- Warning: Failed prop type: The prop `todos[0].title` is marked as required in `TodoList`, but its value is `undefined`
- Failed prop type: The prop `history` is marked as required in `Router`, but its value is `undefined`
- Failed prop type: The prop `children` is marked as required in `Mutation`, but its value is `undefined`
- Failed prop type: The prop `children` is marked as required in` Sidebar`, but its value is `undefined`
- Failed prop type: The prop `id` is marked as required in `FormattedMessage`, but its value is `undefined`
- Warning: Failed prop type: The prop `createCourse` is marked as required in `CoursesPage`, but its value is `undefined`
- Failed prop type: The `` is marked as required in ``, but its value is `undefined`
- Failed prop type: The prop `actions` is marked as required in `Testing`, but its value is `undefined`
- Failed prop type: The prop `location` is marked as required in `PrivateRoute`, but its value is `undefined`
- Warning: Failed prop type: The prop `alt` is marked as required in `MainImage`, but its value is `undefined`. MainImage
- How to fix this issue “Warning: Failed prop type: The prop `title` is marked as required in `Tab`, but its value is `undefined`.”
- Failed prop type: The prop `message` is marked as required in `Description`, but its value is `undefined`
- warning.js:36 Warning: Failed prop type: The prop `history` is marked as required in `Router`, but its value is `undefined`
- Failed prop type: The prop `setToken` is marked as required in `Login`, but its value is `undefined`
- Using .map and getting Warning: Failed prop type: The prop `to` is marked as required in `Link`, but its value is `undefined`
- Warning: Failed prop type: The prop `exercise` is marked as required in `EditExercise`, but its value is `undefined`
- Failed prop type: The prop `options` is marked as required in `signupCheckBoxes`, but its value is `undefined`
More Query from same tag
- Is it possible to move code outside a functional component?
- Adding Active class to react sidebar
- React/Leaflet-side-by-side Error: Map container is already initialized. #35
- What is the best way to render multiple button components with different values?
- When to use useState initial value as function?
- React Router sharing data between components
- How to make the radio buttons work and output values in reactjs
- Add a active class to next div removing from current one in JS
- How to make webpack not use the window object when bundling?
- Handling onClick and onKeyPressDown in the same function React
- Material UI Flexbox issue
- How do I close my Modal using the react-modal component?
- Nextauth token keeps on nesting
- React not rerendering props when render function is provided
- push dynamically coming id's and value's in javascript
- Can I access a value in Formik before onSubmit is run?
- Rendering nested object
- ESLint broken: Rules with suggestions must set the `meta.hasSuggestions` property to `true`
- I can't store data to database using firebase firestore
- Test click event on parent component to show children component
- Change background image with styled-component
- How to remove specific element from a array or object using ES6 spread operators and rest operators
- value is not passed to child component using context in react
- (React) Opening a Modal on Google Maps Marker Click
- Changing the state doesn't work as expected
- Trying to pass variable outside the function
- re-render a functional component on prop change
- How to subtract time using moment
- Firebase Functions Can't set headers after they are sent
- React Native Expo: No vertical scrolling on iOS