Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add notes about React 18 #180

Merged
merged 16 commits into from
Jun 26, 2023
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,19 @@ const Counter = () => {
};
```

## Notes with React 18

This library internally uses `use-context-selector`,
a userland solution for `useContextSelector` hook.
React 18 changes useReducer behavior which `use-context-selector` depends on.
This may cause an unexpected behavior for developers.
If you see more `console.log` logs than expected,
you may want to try putting `console.log` in useEffect.
If that shows logs as expected, it's an expected behavior.
For more information:
- https://github.com/dai-shi/use-context-selector/issues/100
- https://github.com/dai-shi/react-tracked/issues/177

## API

[docs/api](./website/docs/api.md)
Expand Down