Skip to content

Commit 7bfa2ce

Browse files
committed
Add a mention of useStore to "Accessing the Store"
1 parent 63bde33 commit 7bfa2ce

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: docs/using-react-redux/accessing-store.md

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ by a single default context object instance generated by `React.createContext()`
2626
React Redux's `<Provider>` component uses `<ReactReduxContext.Provider>` to put the Redux store and the current store
2727
state into context, and `connect` uses `<ReactReduxContext.Consumer>` to read those values and handle updates.
2828

29+
## Using the `useStore` Hook
30+
31+
The [`useStore` hook](../api/hooks.md#useStore) returns the current store instance from the default `ReactReduxContext`. If you truly need to access the store, this is the recommended approach.
32+
2933
## Providing Custom Context
3034

3135
Instead of using the default context instance from React Redux, you may supply your own custom context instance.

Diff for: website/versioned_docs/version-7.2/using-react-redux/accessing-store.md

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ propagated to connected components, so that this works as expected by default.
1818
However, there may be certain use cases where you may need to customize how the store and state are propagated to
1919
connected components, or access the store directly. Here are some examples of how to do this.
2020

21+
## Using the `useStore` Hook
22+
23+
The [`useStore` hook](../api/hooks.md#useStore) returns the current store instance from the default `ReactReduxContext`. If you truly need to access the store, this is the recommended approach.
24+
2125
## Understanding Context Usage
2226

2327
Internally, React Redux uses [React's "context" feature](https://reactjs.org/docs/context.html) to make the

0 commit comments

Comments
 (0)