Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed React Authentication!
You have completed React Authentication!
Preview
With our app complete, there are parts of our code that we can refactor to minimize duplicate code. In this step, we'll create the api helper function that will make our fetch calls.
Resources
Treehouse Courses and Workshops
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
we will need to call the fetch method and
generate the options object.
0:00
Currently, our app only
makes two fetch calls.
0:03
But imagine if we turned our
app into an online store.
0:07
We would need to make
multiple fetch calls.
0:11
One to get a list of products,
one to get the product details,
0:14
one to let the server know that
the user bought some products.
0:17
You get the point.
0:21
Having to create an options object over
and over again can become tedious.
0:22
Instead, we'll create a helper
function that generates
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up