Skip to content

Conversation

@ixigen
Copy link

@ixigen ixigen commented Jun 22, 2017

Hello, after attempting to apply initial values to a redux form I've noticed that it didn't work when I've followed the new post example. The problem was the order in which the components were wrapped.

First we need to wrap the Form component with reduxForm and then connect it to the redux store.

export default reduxForm({
validate,
form: "PostsNewForm"
})(connect(null, { createPost })(PostsNew));

should be

export default connect(null, { createPost })(
reduxForm({
validate,
form: "PostsNewForm"
})(PostsNew));

@abarlow85
Copy link
Collaborator

Hey,
Check out the Redux Form docs for how they initialize values.
Docs

@ixigen
Copy link
Author

ixigen commented Jun 23, 2017

The docs: connect()(reduxForm()(Form))

The course code had: reduxForm()(connect()(Form))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants