1.0.7 • Published 6 years ago

react-router4-redux v1.0.7

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

react-router-redux

connect react router 4.x and redux.

Install

npm install react-router4-redux --save

//or 
yarn add react-router4-redux

Why && Usage

  • normal

use redux before:

import { connect } from 'react-redux';
export default connect(mapStateToProps)(Something)

after using react-router 4.x:

import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom'
export default withRouter(connect(mapStateToProps)(Something))

oooh that`s so tedious.

but now, you can do just simple redux:

import connect from 'react-router4-redux';
export default connect(mapStateToProps)(Something)
  • use for connect mixins:
import connect from 'react-router4-redux';
export default connect(mapStateToProps)(Something, SomeMixin1, SomeMixin2, SomeMixin3 /*, ....mixins*/)
  • add fetchData func

async fetchData({ dispatch, match }) { await dispatch(someAction()); }

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago