React.js: how to decouple jsx out of JavaScript

前端 未结 5 1201
你的背包
你的背包 2021-01-30 00:08

Is there any way to move the jsx from a component\'s render function to a separate file? If so, how do I reference the jsx in the render function?

5条回答
  •  误落风尘
    2021-01-30 00:35

    You can use react-templates. It gives you exactly this separation between the markup and the component itself, and much more.

    I found it very useful for my needs (a large scale web app).

提交回复
热议问题