Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix new post connect to state #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants