- Read Tutorial
- Watch Guide Video
So this is a really simple fix all we need to do is go into this file newsletterEditForm.js
and go to the redux form and add another configuration option put a comma here and say enable Reinitialize set it to true.
newsletterEditForm.js
editNewsletterForm = reduxForm({ form: "editnewsletter", endableREinitialize: true })(EditNewsletterForm);
So all we are doing is adding these 28 characters, you'll see down here is 28 selected.
What we're doing here is we're adding this in and we're setting it to true and it will basically reload the form once we get initial values. So let's go to Google Chrome let's login and let's hit this edit button, we can now see that we're getting items in here.
All right in the next video, I want to solve two problems with our images you'll see that the images displaying weird here like we can't see it, it's just like an empty image.
And when we hit edit we're not displaying an image here as well.
So I'll show you how to do those both in the next video it's going to take a little bit, or a tiny bit of refactoring, barely any at all, it's really simple. We just need to add in the ROOT_URL in front of our imageUrl.
So let's go ahead and commit our code.
Terminal
git status git add . git commit -m "redux form reinitialize option"
Okay, I'll see you in the next video.