score:6
Accepted answer
The issue is with:
export default withRouter(connect(
null,
mapDispatchToProps
))(DifficultySelection)
The syntax for connect
is connect(mapStateToProps, mapDispatchToProps)(component)
Putting your call on a single line, it's perhaps easier to see the error:
withRouter(connect(null, mapDispatchToProps))(DifficultySelection)
connect
never properly uses DifficultySelection
as an arugment, meaning your file is not returning the connected component.
Simply rearrange it as follows:
export default connect(null, mapDispatchToProps)(withRouter(DifficultySelection))
Or, as suggested in the comments, withRouter
can be omitted since this component will receive props from Route
:
export default connect(null, mapDispatchToProps)(DifficultySelection)
Source: stackoverflow.com
Related Query
- Redux-form, Invalid prop 'value' of type 'number' supplied to 'TextInput', expected 'string'
- Warning: Failed prop type: Invalid prop `value` of type `number` supplied to `TextInput`, expected `string`
- Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function`
- React How to fix Failed prop type - Invalid prop of type string expected object
- Failed prop type: Invalid prop `responsive` of type `string` supplied to `Image`, expected `boolean`
- Failed prop type: Invalid prop of type `function` supplied expected a single ReactElement
- Failed prop type: Invalid prop `children` of type `string` supplied to `DetailField`, expected `object`
- Invalid prop `selected` of type `String` supplied to `Calendar`, expected instance of `Date`?
- react-big-calendar ERROR: Invalid prop `slotStart` of type `date` supplied to `Popup`, expected `number`
- Invalid prop `component` of type `object` supplied to `Route`, expected `function`
- React Victory giving error Invalid prop `data` of type `object` supplied to `VictoryLabel`, expected `array`
- Failed prop type: Invalid prop `match.params` of type `object` supplied to `Page`, expected `string`
- Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function`
- Invariant Violation: invalid prop 'fontSize' of type 'string' supplied to 'Stylesheet generated' expected 'number' - Styled Components RN
- Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function` Error using react-router-dom
- GraphQL: Warning: Failed prop type: Invalid prop `query` of type `object` supplied to `StaticQuery`, expected `string`
- Failed prop type: Invalid prop `params` of type `object` supplied to `SignUp`, expected `array`
- Failed prop type: Invalid prop `element` of type `function` supplied to `Group`, expected `object`
- react-instantsearch-dom:: Failed prop type: Invalid prop `hitComponent` of type `object` supplied to `Hits`, expected `function`
- Failed prop type: Invalid prop `onClick` of type `object` supplied to `ButtonBase`, expected `function`
- Invalid prop `data` supplied to `MaterialTable`, expected one of type [function]
- Failed prop type: Invalid prop `onClick` of type `object` supplied to `Button`, expected `function`
- Warning: Failed prop type: Invalid prop `defaultValue` of type `string` supplied to `AutoCompleteSearch`, expected `function`
- Failed prop type: Invalid prop `count` of type `string` supplied to `ForwardRef(TablePagination)`, expected `number`
- index.js:1 Warning: Failed prop type: Invalid prop `src` of type `object` supplied to `ForwardRef(Avatar)`, expected `string`
- Warning: Failed prop type: Invalid prop `open` of type `function` supplied to `ForwardRef(Dialog)`, expected `boolean`. at Dialog
- Warning: Failed prop type: Invalid prop `items[0]` of type `string` supplied to `ImageGallery`, expected `object`
- Invalid prop 'children' of type 'array' supplied to 'InfoWindow', expected a single ReactElement
- Invalid prop `selectRow` of type `string` supplied to `BootstrapTable`, expected `object`
- Failed prop type: Invalid prop `label` of type `object` supplied to `Button`, expected `string`
More Query from same tag
- react leaflet shown as an overlay
- How to apply ag-grid custom filter when clicking a button
- Trying to import a img in react
- Currency formatting in React / Javascript
- React Display Separate Popover Component on Menu Click
- JS React short circuit for onpress
- 'onChange' is specified more than once, so this usage will be overwritten
- Twitter tells me Error no card found (card error)
- Regex to accept only 7 types of special characters
- Facing issue in restricting the amount of splits
- How to make placeholder for Loadable Component in React SSR
- Webhook reponse data failing with 'map' of undefined
- why returning an **element** from const outcomes as an error?
- React JS: Differentiate between Click and Click + Shift event
- testing react component, mocking props
- REACT every time button is clicked it goes through an arbitrary list of colors but stops working randomly
- Jasmine React Spy not being called?
- Custom `stylelint` plugin for `styled-components`
- Passing arguments to event handlers and getting the value in ReactJS?
- GraphQL error: Cannot query field 'mutation_name' on type 'Mutation'
- How to api call in onChange function on CheckBox field React js
- TypeError: Cannot read properties of undefined (reading 'user')
- React Redux connect is not assignable to type '() => void' with typescript
- React/Tailwind CSS: Search bar filter moving when typed in/filtering data
- React Native FlatList only renders 10 items
- Two independent route systems with react-router
- How to place the Y-axis label vertically center align in apexcharts?
- LocalStorage doesn't set items into itself
- Are ReactJS and jQuery mutual exclusive?
- styled-components' Global Theme only changes theme after F5 on desktop, but works on mobile