@sialvsic/react-redux
v0.0.2
Published
This repo aim to analyze react redux and DIY it.
Downloads
1
Readme
react-redux-analyze
This repo aim to analyze react-redux and DIY it.
React redux 核心组成
- Provider
- connect
const rootElement = document.getElementById('root')
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
rootElement
)
const mapStateToProps = (state /*, ownProps*/) => {
return {
counter: state.counter
}
}
const mapDispatchToProps = { increment, decrement, reset }
export default connect(
mapStateToProps,
mapDispatchToProps
)(Counter)
Teach Path
How to publish to npm
npm publish --access public
npm unpublish @sialvsic/[email protected] -f
How to publish in local with verdaccio
npm publish --registry http://localhost:4873
P.S could install from local by adding this line in the .npmrc file
registry=http://localhost:4873