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

Update react docs to newest api #749

Open
1 of 3 tasks
fhammerschmidt opened this issue Nov 14, 2023 · 0 comments
Open
1 of 3 tasks

Update react docs to newest api #749

fhammerschmidt opened this issue Nov 14, 2023 · 0 comments
Assignees
Milestone

Comments

@fhammerschmidt
Copy link
Collaborator

fhammerschmidt commented Nov 14, 2023

I added a new v0.12.0 docs version to the rescript-11 branch. It only needs to be updated

Below are the relevant changes from the changelog for reference

  • Deprecated use*N functions in favor of changing the signature of the main hook function.
    • For example, useEffect instead of useEffectN e.g. useEffect3(f, (a, b, c)) -> useEffect(f, (a, b, c))
    • The affected hooks include useEffect, useLayoutEffect, useCallback, useMemo, useImperativeHandle, useInsertionEffect
    • With this change, it is now possible to pass any value as the second argument 'deps. In case you pass an invalid value, you will get a warning from React at runtime. You should be using one of the following values for the dependency array:
      • 0 dependencies: []
      • 1 dependency: [a]
      • more than 1 dependency: (a, b, ...)
  • For calling useEffect, useLayoutEffect etc. without a dependency array (meaning that the effect is executed on every render), there are now separate bindings useEffectOnEveryRender, useLayoutEffectOnEveryRender etc.
  • Added React.lazy_.
@fhammerschmidt fhammerschmidt added this to the v11.0 milestone Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants