课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Navigating on link click
课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
Navigating on link click
- [Instructor] We need to add a link here somewhere. Let's put it at the end of this page to go back to a contest list in case we start the application here. So if someone shared this URL we need to give them a way to go back to the contest list. Let's add it right here below everything. And let's use an anchor element here. So a.link, the atreff here is slash, and for a label let's use contest list. This is an html link and this will actually work. So if you go to contest list, it will work but it goes back to the server to fetch the list of contest. It's not a single page application feature. If you want to make it work without going back to the server, for the html we need a handler. On click is something that we need to define. This function needs to actually change the page state element on the app component. So we need to define it here. And it's very similar to this navigate to contest. So I'm going to start with…
内容
-
-
-
-
-
-
Invoking component actions in children7 分钟 40 秒
-
(已锁定)
Displaying a different root component4 分钟 7 秒
-
(已锁定)
Fetching data after navigating to a new view7 分钟 15 秒
-
(已锁定)
Handling browser navigation history7 分钟 14 秒
-
(已锁定)
Server-side rendering of a custom path7 分钟 28 秒
-
(已锁定)
Fetching data conditionally4 分钟 16 秒
-
(已锁定)
Navigating on link click6 分钟 11 秒
-
-