React Router v4 Tutorial - #2 Routes & Links

Опубликовано: 05 Март 2018
на канале: Code Realm
16,917
137

Moving on, let's set up React Router in our app. First, we'll need to render the built-in BrowserRouter as the root component in our tree. With the web router in place, we can start adding Link components that will help us navigate around without page reload. Lastly, to match our client-side routes, we'll use the Route component. Define the pathname under the path prop, and then instruct the router to render some content in response to that path being matched, by either supplying it a "render" or a "component" prop.

All three (BrowserRouter, Link, Route) are React components and can be rendered with JSX tags. That means no static routing, no route config files, no hustle. Sweet!


Смотрите видео React Router v4 Tutorial - #2 Routes & Links онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code Realm 05 Март 2018, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 16,91 раз и оно понравилось 13 людям.