In this video we're going to start to wire up redux form to our project.
We already installed the library two videos ago.
So make sure that you have installed it as well and started up your server again.
Once that's all done I'm going to flip on over to my code editor and we're going to open up our reducers
index file.
So reducers index yes.
Remember when we just discussed redux form a little bit ago I had told you that redux form is going
to do a tremendous amount of stuff for us automatically.
One of the things that redux form is going to do for us is manage all of our form data inside of our
redux store in order to do so we have to wire up producer to our store.
But this is going to be a producer that has been created for us by the redux form library.
So we are not creating this producer.
It has already already been created.
We just installed it into our project when we installed redux form.
So all we have to do is pull that reduce or out of the library and hook it up to our combined reducers
call right here.
So to do so I'm going to add in an import statement at the top.
I'm going to say import reducer from redux Dasch form and then we have to assign this to a very particular
key inside of the combined reducers call.
We are required to wire it up to a key of form.
So I'll say form is coming from reducer.
Now remember any time that we have named exports from a library or a file that we'd write we have to
write out the exact name of that named expert right here.
So we have to import this thing as a variable called reducer.
However a lot of times you might have a lot of different reducers inside of your project.
And so to just have a variable inside of your called reducer is a little bit confusing.
So as a little helpful thing this is absolutely not required at all this is just a helpful thing.
Very frequently we will to use a little bit of syntax here to rename this named export.
When we pull it into this file so we can write optionally reducer as form reducer like so.
So we are importing a named import right here and then we're going to essentially rename it on the fly
on the exact same line of code.
So we will not have a variable inside this file called reducer.
Instead it's going to be imported into this file and given a name of form reducer.
Again this is done just to make sure that it's kind of clear what reducer we are talking about.
At any given point because you might have a lot of different reducers inside this file.
And if you just see one side of your called reducer you would probably say what in the world is this
reducer.
So we're just trying to give it a more descriptive name that's all.
So if we use this syntax right here we no longer have a variable called reducer and we instead have
to write out form reducer like XA OK.
So let's now save this file.
We're going to flip back over to our application and just refresh and make sure that we don't see any
error message.
You will see an error message.
If you assign that reducer to a key other than form inside of your combined reducers call.
Now if you open up your redux dev tools.
Now here's my redux dev tools over here in on making sure that I'm looking at my react up.
You'll notice that if you select state right here and look at tree we have a new key inside of our state
tree or redux store that new key is forms.
That's the reducer that we just set up over time as we start to put foreigns together inside of application.
We're going to see that this piece of state right year has a bunch of data related to the forms that
we have inside of our app.
So as we start to wire together this create form that we're trying to build this one right here.
We're going to see that as we start to type text in here.
All that text and whatnot is going to automatically show up inside of this form object right there inside
of a redux store.
Remember the entire idea here is that with redux form we are still using regex all the same redux you
know in understand just a lot.
The steps are being done for us automatically OK now that we have wired up Bre-X form.
We're going to take a quick pause when we come back the next video.
We're going to start working on our create stream form and understand how to work with redux form in
general.
So quit posin I'll see you in just a minute.