Skip to content

Commit b2f2719

Browse files
committed
docs: add nots about React 18
1 parent a19bd68 commit b2f2719

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,19 @@ const Counter = () => {
186186
};
187187
```
188188
189+
## Notes with React 18
190+
191+
This library internally uses `use-context-selector`,
192+
a userland solution for `useContextSelector` hook.
193+
React 18 changes useReducer behavior which `use-context-selector` depends on.
194+
This may cause an unexpected behavior for developers.
195+
If you see more `console.log` logs than expected,
196+
you may want to try putting `console.log` in useEffect.
197+
If that shows logs as expected, it's an expected behavior.
198+
For more information:
199+
- https://github.com/dai-shi/use-context-selector/issues/100
200+
- https://github.com/dai-shi/react-tracked/issues/177
201+
189202
## API
190203
191204
[docs/api](./website/docs/api.md)

0 commit comments

Comments
 (0)