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 move the error displaying code into it's own component.
This video doesn't have any notes.
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
can refactor to minimize duplicate
code and improve maintainability.
0:00
The code for displaying errors
in both our UserSignIn and
0:00
UserSignUp components is identical.
0:04
Let's create a component that
displays a list of errors.
0:08
So we can minimize
the duplication of code and
0:12
reuse the component in case
we extend the application.
0:15
For example, if we turn this app
into a library manager website,
0:19
we would like to display a list
of errors if a librarian tries
0:24
to add a blank book to the database.
0:29
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