使用 React 编写 TodoList 功能
/src/index.js
import React from 'react';
import ReactDom from 'react-dom';
import TodoList from './TodoList';
//ReactDom.render(<div>hello world</div>),document.getElementById('root');
ReactDom.render(<TodoList />),document.getElementById('root');
/src/TodoList.js
import React, { component } from 'react';
class TodoList extends Component {
render(){
<Fragment>
<input />
<ul>
<li>dsfasf</li>
<li>dsfasf</li>
</ul>
</Fragment>
}
}
export default TodoList;