课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Fetching data conditionally
课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
Fetching data conditionally
- Let me review everything we did real quick. We changed the server to accept the path for a contest. We made server Render aware of it which means, when we go to a slash contest endpoint the initial data is going to have a current contest object and it will not have the contest list. It will only have a current contest object. We changed the app component to not rely on a current contest ID string, but rather on a current contest object. If there is a current contest object in the initial data, we render the contest page, otherwise we render the contest list page. If there is a current contest in the initial data then the current contest state element, here in the app component, will have that initial data. And to make all this work, when we set the current contest and we do that either when we navigate to a contest here or when we handle the state record going back to a contest page. We just fake an object that has the ID…
内容
-
-
-
-
-
-
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 秒
-
-