Skip to content

Commit

Permalink
Add doc on how to test with yarn link
Browse files Browse the repository at this point in the history
  • Loading branch information
supasate committed Dec 27, 2018
1 parent 2301bb9 commit 27bb9d5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,34 @@ npm run build
```
Generated files will be in the `lib` folder.

Development
-----------
When testing the example apps with `npm link` or `yarn link`, you should explicitly provide the same `Context` to both `Provider` and `ConnectedRouter` to make sure that the `ConnectedRouter` doesn't pick up a different `ReactReduxContext` from a different `node_modules` folder.

In `index.js`.
```js
...
import { Provider, ReactReduxContext } from 'react-redux'
...
<Provider store={store} context={ReactReduxContext}>
<App history={history} context={ReactReduxContext} />
</Provider>
...
```

In `App.js`,
```js
...
const App = ({ history, context }) => {
return (
<ConnectedRouter history={history} context={context}>
{ routes }
</ConnectedRouter>
)
}
...
```

Contributors
------------
See [Contributors](https://github.com/supasate/connected-react-router/graphs/contributors) and [Acknowledge](https://github.com/supasate/connected-react-router/blob/master/ACKNOWLEDGE.md).
Expand Down

0 comments on commit 27bb9d5

Please sign in to comment.