question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: fields must be passed when initializing state

See original GitHub issue
import 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:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
thom-niccommented, Jun 20, 2017

I encountered this problem as of v5.3.4 up to v5.3.6, rolling back to v5.3.3 fixed it.

0reactions
lock[bot]commented, Jun 20, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found