Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
559 views
in Technique[技术] by (71.8m points)

react-router进行服务端渲染时候引入组件为什么出错

clipboard.png

react-router在进行服务端渲染时,用node启一个express服务器,当把一个React组件(图中的Index组件)引入到这个server.js文件中,然后在命令行node server.js就报错,引入这个react组件用node启动这个文件就报错,这个问题该如何解决?node运行的文件中能不能import或者require引入react组件?或者react-router这个服务端渲染该怎么弄?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

在.babelrc文件里配上jsx环境


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...