From c7eb03fc4a0a567b84867af4d5fec8b81cfb2dfe Mon Sep 17 00:00:00 2001 From: Alex Buimistriuc Date: Thu, 22 Jun 2017 13:46:58 +0300 Subject: [PATCH] fix new post connect to state --- blog/src/components/posts_new.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/blog/src/components/posts_new.js b/blog/src/components/posts_new.js index ce9bd401..7e4b66f8 100644 --- a/blog/src/components/posts_new.js +++ b/blog/src/components/posts_new.js @@ -73,7 +73,14 @@ function validate(values) { return errors; } -export default reduxForm({ - validate, - form: "PostsNewForm" -})(connect(null, { createPost })(PostsNew)); +export default connect( + null, + { createPost } +)( + reduxForm({ + validate, + form: "PostsNewForm", + enableReinitialize: true + }) + (PostsNew) +);