1 00:00:01,230 --> 00:00:03,030 Instructor: In the last section we discussed the need 2 00:00:03,030 --> 00:00:06,060 to define our context types object right here. 3 00:00:06,060 --> 00:00:08,700 Remember, context is something just like props 4 00:00:08,700 --> 00:00:10,680 but allows us to kind of skip levels 5 00:00:10,680 --> 00:00:12,660 in our component hierarchy. 6 00:00:12,660 --> 00:00:15,300 React forcibly prevents you from 7 00:00:15,300 --> 00:00:17,490 abusing this idea of context 8 00:00:17,490 --> 00:00:21,810 by forcing you to define these context type properties. 9 00:00:21,810 --> 00:00:24,510 When we had console logged our context 10 00:00:24,510 --> 00:00:26,280 with this dot context, 11 00:00:26,280 --> 00:00:28,440 we got just an empty object. 12 00:00:28,440 --> 00:00:30,120 So if we wanna get access to our router, 13 00:00:30,120 --> 00:00:31,567 we need to say ahead of time, 14 00:00:31,567 --> 00:00:33,540 "Hey there's gonna be a router property. 15 00:00:33,540 --> 00:00:35,220 We definitely wanna get access to it 16 00:00:35,220 --> 00:00:37,797 and it's gonna be of type object." 17 00:00:38,820 --> 00:00:41,220 Now we still need to talk about the syntax here 18 00:00:41,220 --> 00:00:43,380 but first let's just do a quick console log 19 00:00:43,380 --> 00:00:45,810 and see if we can't see an additional property 20 00:00:45,810 --> 00:00:47,610 on our context now. 21 00:00:47,610 --> 00:00:50,460 So I'm gonna flip back over to the browser, refresh, 22 00:00:50,460 --> 00:00:52,890 and you can now see just like magic, 23 00:00:52,890 --> 00:00:55,230 our router object is now available. 24 00:00:55,230 --> 00:00:59,820 And we can see stuff on here like go, push, replace, 25 00:00:59,820 --> 00:01:02,760 all of these very relevant methods for navigation. 26 00:01:02,760 --> 00:01:05,040 So we'll handle the navigation a little bit. 27 00:01:05,040 --> 00:01:07,640 Let's finish up talking about the syntax right here. 28 00:01:09,360 --> 00:01:10,710 So the syntax, 29 00:01:10,710 --> 00:01:12,270 using the static keyword, 30 00:01:12,270 --> 00:01:15,063 defines what's called a class level property. 31 00:01:16,290 --> 00:01:20,670 Saying static context types equals object 32 00:01:20,670 --> 00:01:22,440 gives any other application 33 00:01:22,440 --> 00:01:25,260 or any other piece of code inside of our application, 34 00:01:25,260 --> 00:01:29,700 the ability to reference authentication dot context types. 35 00:01:29,700 --> 00:01:30,660 So literally, 36 00:01:30,660 --> 00:01:31,590 I'm gonna put just a, 37 00:01:31,590 --> 00:01:32,910 I'm gonna delete this in just a second 38 00:01:32,910 --> 00:01:35,793 but I'm gonna say Authentication.contextTypes. 39 00:01:38,850 --> 00:01:39,683 Now you'll notice 40 00:01:39,683 --> 00:01:42,240 that I didn't have to create an instance of authentication. 41 00:01:42,240 --> 00:01:44,010 I just went ahead and called it. 42 00:01:44,010 --> 00:01:48,450 So the static keyword is defining a property or an object 43 00:01:48,450 --> 00:01:50,430 on the class, 44 00:01:50,430 --> 00:01:51,510 on the actual class. 45 00:01:51,510 --> 00:01:52,710 Not an instance of the class, 46 00:01:52,710 --> 00:01:53,850 but the actual class. 47 00:01:53,850 --> 00:01:56,350 That's all the static keyword right here is doing. 48 00:01:59,700 --> 00:02:02,550 So with a better idea of what the static keyword is doing, 49 00:02:02,550 --> 00:02:04,350 let's go ahead and continue the next section 50 00:02:04,350 --> 00:02:07,050 where we're going to figure out how to navigate around 51 00:02:07,050 --> 00:02:10,410 using this new router property that we just got access to. 52 00:02:10,410 --> 00:02:11,610 I'll see you over there.