Skip to content

Commit 9349dd9

Browse files
committed
update README
1 parent c2bfe43 commit 9349dd9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77

88
React useContextSelector hook in userland
99

10+
> [!IMPORTANT]
11+
> The goal of this library is to emulate the behavior of the React Context API with Concurrent React.
12+
> Many users try to use this library to avoid re-renders without needing to consider Concurrent React.
13+
> If you simply want to avoid re-renders, we recommend one of the following:
14+
> - [Zustand](https://github.com/pmndrs/zustand)
15+
> - [A naive implementation with useSyncExternalStore](https://github.com/dai-shi/use-context-selector/issues/109#issuecomment-1785147682)
16+
> - [Experimental react18-use](https://github.com/dai-shi/react18-use)
17+
> [Learn more](https://github.com/dai-shi/use-context-selector/issues/149)
18+
1019
## Introduction
1120

1221
React Context and useContext is often used to avoid prop drilling,
@@ -45,8 +54,6 @@ To make it work like original React context, it uses
4554
It also requires `useContextUpdate` to behave better in concurrent rendering.
4655
Its usage is optional and only required if the default behavior is unexpected.
4756

48-
If you need a simpler solution, you can use `useSyncExternalStore` without any libraries. See [an example](https://github.com/dai-shi/use-context-selector/issues/109#issuecomment-1785147682).
49-
5057
## Usage
5158

5259
```javascript

0 commit comments

Comments
 (0)