1
00:00:00,170 --> 00:00:00,590
All right.

2
00:00:00,590 --> 00:00:07,490
And up next, let's set up the all jobs context and the reason why we want to set up another context

3
00:00:07,490 --> 00:00:10,790
in here, because jobs container.

4
00:00:11,590 --> 00:00:17,800
As well as the search container is going to contain more components and there's going to be some values

5
00:00:17,800 --> 00:00:21,310
that we basically want to grab from the all jobs.

6
00:00:21,460 --> 00:00:25,330
And of course, you can pass them as props.

7
00:00:25,510 --> 00:00:30,730
But again, in my experience, people then start complaining why we're passing them as props.

8
00:00:30,730 --> 00:00:34,150
So I'll raise it up with the context approach.

9
00:00:34,180 --> 00:00:40,180
Again, please keep in mind, just like the previous one that we set up in the dashboard context, remember

10
00:00:40,210 --> 00:00:41,470
this one over here?

11
00:00:42,060 --> 00:00:47,580
When we were passing these values to the small sidebar big sidebar, as well as the nav bar.

12
00:00:47,610 --> 00:00:49,770
Technically, it is optional.

13
00:00:49,800 --> 00:00:52,690
Again, the result is going to be exactly the same.

14
00:00:52,710 --> 00:00:55,800
So let's go to all jobs.

15
00:00:56,040 --> 00:01:01,770
In order to create the context, first of all, we want to go with const and come up with a name.

16
00:01:01,980 --> 00:01:04,680
In my case, it's going to be all jobs.

17
00:01:05,430 --> 00:01:10,260
Context that is equal to create context, which is coming from React.

18
00:01:10,260 --> 00:01:16,770
And then as far as the return, well, instead of the fragment, now let's go with all jobs context

19
00:01:16,770 --> 00:01:23,610
and then we're looking for provider and we want to pass in the value prop and in there for now we're

20
00:01:23,610 --> 00:01:30,030
just going to pass in the data again our object and there of course we have the jobs property.

21
00:01:30,030 --> 00:01:31,440
So that's the starting point.

22
00:01:31,440 --> 00:01:38,340
And also I want to set up the hook, which of course we're going to use pretty much in the next video.

23
00:01:38,340 --> 00:01:40,680
So let's go here with export const.

24
00:01:42,090 --> 00:01:46,350
And as far as the name, I'm going to go with, use all jobs.

25
00:01:48,700 --> 00:01:51,760
Context, and that is equal to my function.

26
00:01:51,760 --> 00:01:59,920
And from this function I simply want to return, use context and pass in the all jobs context.

27
00:01:59,920 --> 00:02:04,090
And with this in place, we're ready to move on to the next step.

