Error: fields must be passed when initializing state
See original GitHub issueimport React, { PropTypes } from 'react';
import { Field, reduxForm } from 'redux-form';
const Searchbar = ({ handleSubmit }) => (
<form onSubmit={handleSubmit}>
<Field name="q" component="input" type="text"/>
<button type="submit" >Search</button>
</form>
);
Searchbar.displayName = 'Searchbar';
Searchbar.propTypes = {
handleSubmit: PropTypes.func
};
export default reduxForm({
form: 'search'
})(Searchbar);
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Error: fields must be passed when initializing state, How so?
The error points towards the ReactDOM.render line of code. but I can't find ... import React from 'react'; import { Field,reduxForm } from ......
Read more >Error: fields must be passed when initializing state, How so?
Coding example for the question Error: fields must be passed when initializing state, How so?-Reactjs.
Read more >Initializing State | Redux
All reducers are passed undefined on initialization, so they should be written such that when given undefined , some value should be returned....
Read more >Initializing From State - Redux Form
There are two methods to reinitialize the form component with new "pristine" values: Pass a enableReinitialize prop or reduxForm() config parameter set to...
Read more >Where to Initialize State in React - Dave Ceddia
There are two ways to initialize state in a React component: inside the constructor, and directly inside the class. Here are a couple ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I encountered this problem as of v5.3.4 up to v5.3.6, rolling back to v5.3.3 fixed it.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.