【问题标题】:Is there a way to server side render react app?有没有办法让服务器端渲染反应应用程序?
【发布时间】:2021-02-07 13:49:29
【问题描述】:

我之前使用 html 和 css 没有使用前端框架,但现在我使用 Reactjs,我想知道如何使用 html 以这种方式呈现服务器端页面:

const app = express();
app.get("/",function(req,res){
 res.render("page");
});

【问题讨论】:

标签: node.js reactjs express


【解决方案1】:

使用Next.js轻量级react框架,包含通过服务端/客户端页面渲染,创建动态页面,支持服务端和服务端less target和webpack,babel配置等。

https://nextjs.org/docs/getting-started https://github.com/vercel/next.js/discussions/14953#discussioncomment-34938

【讨论】:

  • 太好了。谢谢
猜你喜欢
  • 2017-01-14
  • 1970-01-01
  • 2023-03-21
  • 2019-02-09
  • 2018-10-02
  • 2015-05-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多