问题 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? 回答1: Here is a pattern for separating the template jsx that uses CommonJS modules in NodeJS, Browserify or Webpack. In NodeJS, I found the node-jsx module helpful to avoid the need to compile the JSX. // index.js require('node-jsx').install({extension: '.jsx'}); var React = require('react'), Component = require('./your-component'); // your-component