Open WangShuXian6 opened 6 years ago
计数器示例-版本1 index.js
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; //import App from './App'; import registerServiceWorker from './registerServiceWorker'; import {store} from './store' import {Provider} from 'react-redux' import Counter2 from './components/counter2'
ReactDOM.render(
计数器示例-版本2 index.js
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; //import App from './App'; import registerServiceWorker from './registerServiceWorker'; import {store} from './store' import {Provider} from 'react-redux' import Counter2 from './components/counter2'
ReactDOM.render(
const VisibleTodoList = connect( mapStateToProps, mapDispatchToProps )(TodoList)
const mapStateToProps = (state, ownProps) => { return { active: ownProps.filter === state.visibilityFilter } }