你不用非得全部采用 React。组件的生命周期事件,特别是componentDidMount 和 componentDidUpdate,非常适合放置其他类库的逻辑代码。var App = React.createClass({ getInitialState: function() { return {myModel: new myBackboneModel({items: [1, 2, 3]})}; }, componentDidMount: function() { $(this.refs.placeholder.getDOMNode()).append($('<
你没办法通过 this.props.children 取得当前组件的子元素。 因为this.props.children 返回的是组件拥有者传递给你的 passed onto you 子节点。var App = React.createClass({ componentDidMount: function() { // This doesn't refer to the `span`s! It refers to the children between // last line's `<App></App>`, which are undefined.