简体   繁体   English

ReactJS预处理index.html

[英]ReactJS preprocessed index.html

I'm aware that Facebook uses React for developing their front end. 我知道Facebook使用React开发前端。 I'm a little bit new to ReactJS, and so far I have seen that the server returns the index.html and loads the components on the root div. 我对ReactJS有点陌生,到目前为止,我已经看到服务器返回index.html并将组件加载到根div上。

Looking at the source code of facebook.com, I realized that the response index.html has some preprocessed data and different scripts. 查看facebook.com的源代码,我意识到响应index.html具有一些预处理的数据和不同的脚本。 Can anyone tell me how they do for responding with a preprocessed index.html? 谁能告诉我如何使用预处理的index.html进行响应?

You have to render react on the server to enable such functionality. 您必须在服务器上进行反应才能启用此类功能。 Using a framework like Nextjs would help you achieve this. 使用Nextjs之类的框架将帮助您实现这一目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM