Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for push state using react-redux with connect #179

Merged
merged 1 commit into from Nov 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions FAQ.md
Expand Up @@ -16,6 +16,22 @@ import { push } from 'connected-react-router'
store.dispatch(push('/path/to/somewhere'))
```

#### with react-redux
```js
import { push } from 'connected-react-router'

// in component render:
<div onClick={() => {

/** do something before redirection */
props.push('/home');

}}>login</div>

// connect the action:
export default connect(null, { push })(Component);
```

#### in redux thunk
```js
import { push } from 'connected-react-router'
Expand Down