Open manwuyu opened 8 years ago
你的demo 是可以渲染出DOM元素的,但是app.jsx文件中的事件不知道在哪? 比如 下面是我的jsx文件 其中handleChange ,handleClick,handleFocus三个方法没有了
`var React = require('react'); module.exports = React.createClass({ displayName: 'App', getInitialState: function () { return ({ isShow: true, inputText: "placeholder" }); }, render: function() { var style = { display: this.state.isShow ? "block" : "none" }; return (
{this.state.inputText}
);
},
handleChange: function(e) {
this.setState({
inputText: e.target.value
});
},
handleClick: function() {
this.setState({
isShow: !this.state.isShow
});
},
handleFocus: function() {
this.refs.destination.focus();
}
}); `
这个组件是用于服务端渲染,服务端渲染不会将前端的事件渲染出来,这是服务端渲染这种方式所决定的,服务端渲染完成后需要通过前端代码重新初始化 React App
@manwuyu 可以具体描述下遇到的问题么