共index.js、index.html、 TodoList.js这三个文件,主要看TodoList.js中的Input标签的style样式双花括号{ {}}的写法,会在下方做全面的解释
运行效果:
index.js:
import React from 'react';
import ReactDOM, { unmountComponentAtNode } from 'react-dom'
import TodoList from './TodoList'
ReactDOM.render(<TodoList />,document.getElementById('root'))
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>TodoList</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
TodoList.js:
import