Skip to content

Commit

Permalink
Update accessing-store.md (#1163)
Browse files Browse the repository at this point in the history
- Consistent indent
- Consistent semicolons
- Removed endless recurrency from example App component
  • Loading branch information
yuriyyakym authored and timdorr committed Jan 15, 2019
1 parent 5199d9d commit 63af52f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/using-react-redux/accessing-store.md
Expand Up @@ -47,13 +47,13 @@ export default connect(
mapDispatch,
null,
{ context: MyContext }
)(MyComponent)
)(MyComponent);

// or, call connect as normal to start
const ConnectedComponent = connect(
mapState,
mapDispatch
)(MyComponent)
)(MyComponent);

// Later, pass the custom context as a prop to the connected component
<ConnectedComponent context={MyContext} />
Expand Down Expand Up @@ -85,13 +85,13 @@ const storeB = createStore(reducerB);

// supply the context instances to Provider
function App() {
return (
<Provider store={storeA} context={ContextA} />
<Provider store={storeB} context={ContextB}>
<App />
</Provider>
</Provider>
);
return (
<Provider store={storeA} context={ContextA} />
<Provider store={storeB} context={ContextB}>
<RootModule />
</Provider>
</Provider>
);
}

// fetch the corresponding store with connected components
Expand Down Expand Up @@ -132,7 +132,7 @@ function MyConnectedComponent() {
// component where it can be used in lifecycle methods
}}
</ReactReduxContext.Consumer>
)
);
}
```

Expand Down

0 comments on commit 63af52f

Please sign in to comment.