This course will be retired on April 12, 2021.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
In this video, you'll learn the benefits Redux can add to your applications.
Further Reading
In the previous video,
you learned some of the basics of Redux.
0:00
And I've provided
preliminary information for
0:03
components in a React Redux application.
0:05
But now, you may be wondering, why should
I bother using Redux in the first place?
0:08
Or, when should I actually use it?
0:11
Redux does add substantial
overhead to your project and
0:14
expects you to follow some
very explicit patterns.
0:17
So let's discuss some of the benefits
you'll have when you incorporate
0:20
Redux into your applications.
0:22
But before we do that, I should also
mention that Redux does not require
0:25
that you use React as your view library.
0:29
We simply chose to reuse the scoreboard
app because reacting redux align
0:31
themselves almost perfectly.
0:35
And React provides a written
familiar environment to work in.
0:37
First, let's start with a very common
scenario in application development.
0:40
You've decided to build an application,
and you've heard great things about react.
0:45
So you immediately start
building components and
0:48
wiring up a really nice looking UI.
0:51
Your app is tested, regularly launched,
and everything is going great.
0:53
So what could possibly go wrong?
0:56
Well, shortly after
the successful launch of your app,
0:58
you realized that you need to
make some changes to the app.
1:01
And that a number of changes involve
sharing data across components
1:04
within the application.
1:07
Not only do you need to create the new
UI components to support the new
1:08
development request.
1:11
But you also need to figure
out a way to synchronize and
1:13
share data throughout the application.
1:15
Redux to the rescue.
1:18
Redux comes equipped with the facilities
to provide a single source of truth for
1:19
your application.
1:23
Making it easier to keep your
application state in sync, and
1:24
distribute state data in a predictable and
deterministic way.
1:27
Resulting in a more reliable and
stable application.
1:31
In other words, when you use Redux
with React, Redux handles all your
1:34
data management while React only manages
the presentation and the use of your app.
1:38
So now, we know that one of
the primary benefits of Redux is
1:43
its ability to make applications
more predictable, scalable, and
1:46
stable, but what other benefits are there?
1:49
Redux is considered to be
an opinionated framework.
1:52
This means that Redux expects you to
implement features a specific way.
1:55
Otherwise, you're app will
not work as you would expect.
1:59
This is good for a couple of reasons.
2:02
First, it means that Redux should be
implemented following a consistent pattern
2:04
making it easier for anyone familiar with
Redux to look at another app using Redux,
2:09
and immediately feel right at home
with the application structure.
2:13
Second, by following the design
patterns recommended by redux.
2:17
It makes debugging and testing your
application much easier because
2:21
application responsibilities
are distinct and isolated.
2:24
Now that we've covered a few of
the benefits of why Redux is a valuable
2:29
framework, it's time to jump
into creating our project.
2:32
But before we do, I want to
re-emphasize that React applications do
2:35
not require that you use Redux.
2:38
In fact, for
a very simple react application or
2:41
a web application that only uses minimal
React components, Redux is overkill.
2:44
So one of the things you should do before
implementing Redux is make sure that
2:49
your application will
benefit from using it.
2:52
There's a fantastic article about using
Redux written by the creator of Redux,
2:56
that can be found in the teachers
notes for this video.
3:01
So I encourage you to check that out,
along with other information about some of
3:03
the powerful features and benefits that
Redux will bring to your application.
3:06
You need to sign up for Treehouse in order to download course files.
Sign up