score:0
i solve the problem, when use form component, don't input props. for example:
@reduxform({
form: 'demo'
})
class demo extends component {
render () {
return (
<form>
<field component="input" label="name" name="name"></field>
</form>
);
}
}
class container extends component {
render() {
return (<demo {...this.props}></demo>); // !!==> remove this.props.
}
}
the reason will be complete later... i will find.
score:0
seconding honpery's answer to their own question and expanding upon it a little bit. it appears that if you pass a prop to your form component named 'form', it gets all confused.
so, for example:
<contactform
form={this.props.form}
/>
is going to end in sadness. changing it to:
<contactform
formdetails={this.props.form}
/>
gets rid of that weird error/issue.
score:1
you get this error, because reduxform
expects to receive a settings object with form: "string"
where string is your form name. according to the error, you passed an object to the form attribute in your settings, e.g. form: { ... }
. if you can show your form code i could point to an exact fix.
score:1
@deividas karžinauskas had it right, but his answer wasn't accepted for some reason. setting form: {...}
to an object instead of a string is where the problem is occurring. removing it for me got rid of the error.
for a more hands on example:
erroneous code:
export default connect(
state => ({ ...state.lotoperation, form: state.lotoperationform }),
dispatch => bindactioncreators(actioncreators, dispatch))(lotoperationindex)
solution
export default connect(
//notice here i'm not setting "form: {..}" to an object anymore.
state => ({ ...state.lotoperation }),
dispatch => bindactioncreators(actioncreators, dispatch))(lotoperationindex)
Source: stackoverflow.com
Related Query
- redux form : Invalid prop `form` of type `object`
- React How to fix Failed prop type - Invalid prop of type string expected object
- Redux - Error: Invalid value of type object for mergeProps
- React, React Redux, Redux Form type is invalid
- Expected onClick listener to be a function, instead got type object - react redux
- Warning: Failed propType: Invalid prop of type `array` expected `object` with React
- React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object
- 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`
- Warning: Failed prop type: Invalid prop `error` of type `string` expected `boolean`
- Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function`
- React-Redux error Invalid prop `children` of type `object` supplied to `Provider`
- React.createElement: type is invalid -- expected a string, but got: object
- Redux form onSubmit values empty object in testing
- 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 `opacity` of type `object` supplied to `RCTView`
- Failed prop type: Invalid prop `children` of type `string` supplied to `DetailField`, expected `object`
- React Warning: Failed prop type: Invalid prop of type `Object` supplied
- Typescript - infer generic type from object prop value
- Redux form - adding dynamically prop name to FormSection
- Redux Form - You must either pass handleSubmit() an onSubmit function or pass onSubmit as a prop
- reactjs - redux form and material ui framework -- with auto type - and clearing field functionality
- React's invalid prop type 'array' expected 'object'
- Invalid prop `selected` of type `String` supplied to `Calendar`, expected instance of `Date`?
- React - Redux Error: Element type is invalid after connect
- 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-router-dom Failed prop type: Invalid prop `exact` of type `string`
- React Victory giving error Invalid prop `data` of type `object` supplied to `VictoryLabel`, expected `array`
More Query from same tag
- Error: Objects are not valid as a React child (found: [object Promise])
- Get last state even after refresh ReactJS with Hooks
- how to set react useState in useEffect and in window.addEventListener
- I want to directly call the result value by arithmetic operation on two state values
- How to add an onClick event to a variable outside my class extends?
- How to test if iframe exists with React testing library?
- difficulties moving aframe camera and emitting events to wasd-controls of aframe camera
- How to format date in a material UI textfield?
- React. Can't acces API data on local 5000. Database from CSV file. Promise undefined response
- How to segregate the value of a JavaScript objects into Array efficiently?
- this.state.characters.map is not a function
- Bold Text conditionally in JSX
- How to create a simple react app in one file?
- How to POST new data via Ajax on React JS
- How to get data from React root component?
- ReactJS Text Input
- reactjs passing a callback results in undefined
- AsyncStorage in a non async function
- I get a "hydration failed" error while trying to use Recharts in Nextjs. Has anyone solved this problem before?
- css flex-box nested layout have issue
- How to hide a component in react?
- Check for microphone permissions on safari
- Avoid opening file selection popup
- Query API with Array Parameters in React
- How to set multiple object values when using Immutable JS map
- Multiline assignment in es2015
- How to pass props from functional component to class component
- Can anyone assist with a Type Error issue while using .map() in React?
- React big calendar, add bootstrap popover to event?
- How to make loading screen in ReactJS web app like splash in React Native