课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Server-side rendering of the root path
课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
Server-side rendering of the root path
- [Instructor] The application is now rendering data from the API server with JavaScript. But what happens if we don't have JavaScript? We can actually disable JavaScript here in Chrome Dev tools down in the settings, there is a disable JavaScript option and if we test with JavaScript disabled the application is empty. The only thing that it renders is the original content that we rendered in the EJS template. This is what most search engines see if they request the application. Ideally, we want the application to render from the server as seen by React so that we get the benefits of search engine optimizations and also we get a little bit of performance benefit. Instead of waiting for React to warm up, render the component and then go back to the server to fetch the data, we can have an initial view ready by the server. So to do that let's go to server.ts and what we need is to modify this instead of a loading message,…
内容
-
-
-
-
-
Creating a mock API endpoint5 分钟 52 秒
-
(已锁定)
Using an API endpoint from the browser9 分钟 2 秒
-
(已锁定)
Rendering a list of items8 分钟 47 秒
-
(已锁定)
React’s key for items in a list4 分钟 29 秒
-
(已锁定)
Fetching data while React is rendering8 分钟 5 秒
-
(已锁定)
Server-side rendering of the root path7 分钟 41 秒
-
(已锁定)
Sharing data between server and client5 分钟 1 秒
-
(已锁定)
Fetching data from MongoDB6 分钟 17 秒
-
-
-