刚学react 帮看个问题?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title&g优艾设计网_PS问答t;Document</title> <script src="js/react.js"></script> <script src="js/react-dom.js"></script> <script src="js/browser.min.js"></script> </head> <body><div id="example_1"></div><div id="example_2"></div><script type="text/babel">var GreetMessage = React.createClass({getInitialState:function(){return {value:0,listDom:[<li>{this.value}</li>]};},handleClick:function(){var _this = this;this.state.listDom.push(<li>{_this.state.value}</li>);this.setState({value:this.state.value+1});},render:function(){ var list = this.state.listDom.map(function(li){ return li })return (<ul> {list} </ul>)}}); ReactDOM.render(<GreetMessage/>,document.getElementById("example_1"));</script>
这是错哪了?
精彩评论