1
00:00:01,260 --> 00:00:10,770
On on you go on to this point, you have a lot in your two birds, but without states, react is nothing.

2
00:00:10,980 --> 00:00:19,980
So in this section it's about managing states in React, using what is called use state hook.

3
00:00:20,340 --> 00:00:24,690
So if you're new to react, maybe asking what is hook?

4
00:00:25,080 --> 00:00:33,060
A hook is a way of using lifecycle method inside functional component.

5
00:00:33,300 --> 00:00:41,190
But because React is moving towards functional component, we can make use of hook in any way we want

6
00:00:41,190 --> 00:00:43,770
in application to make our life pretty easy.

7
00:00:44,010 --> 00:00:51,480
So in a nutshell, what is a state application is all about state.

8
00:00:51,960 --> 00:00:54,930
Application without a state is.

9
00:00:55,890 --> 00:00:58,500
Meaning it's not an application.

10
00:00:58,890 --> 00:01:03,330
So state makes the entire application.

11
00:01:03,750 --> 00:01:04,230
All right.

12
00:01:04,230 --> 00:01:08,100
So let's have a look at managing states in React.

13
00:01:08,430 --> 00:01:15,480
And managing states and React is a complex topic on its own because state is something you need to pay

14
00:01:15,480 --> 00:01:16,350
attention to.

15
00:01:16,770 --> 00:01:25,890
So we have one mechanism called use states, meaning it's a kind of a data storage, temporary in our

16
00:01:25,890 --> 00:01:26,700
application.

17
00:01:27,000 --> 00:01:34,700
So we can use you state and also we can use what is called the context API and most importantly, redux.

18
00:01:34,710 --> 00:01:37,570
So I don't want to bombard you with all these technical terms.

19
00:01:37,590 --> 00:01:41,130
So let's move slowly and start with use state.

20
00:01:41,580 --> 00:01:42,120
Great.

21
00:01:42,120 --> 00:01:52,200
So since React 16.8 hooks have been available in React Call library hooks provide an alternative to

22
00:01:52,200 --> 00:01:59,970
classes and allow you to use state and other react features without right in a class based component.

23
00:02:00,540 --> 00:02:02,550
So what is use?

24
00:02:02,550 --> 00:02:06,510
States have even explained that they used it.

25
00:02:06,510 --> 00:02:16,680
Hook is a function that takes a single argument, which is the initial state of the components they

26
00:02:16,680 --> 00:02:16,900
use.

27
00:02:16,900 --> 00:02:21,630
State Hook then returns an array of two elements.

28
00:02:21,660 --> 00:02:27,570
The first element is the current state of the component, and the second element is a function that

29
00:02:27,570 --> 00:02:31,650
allows you to update the state of the component.

30
00:02:31,770 --> 00:02:41,880
So the next video you talk about how we can use you state by demonstrating what you talk about, what

31
00:02:41,880 --> 00:02:44,940
is use state in the next video.

