Skip to content

Commit

Permalink
Undeprecate numbered hooks for a smoother upgrading experience
Browse files Browse the repository at this point in the history
  • Loading branch information
fhammerschmidt committed Feb 9, 2024
1 parent 4f73fee commit 7405e5e
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 105 deletions.
96 changes: 40 additions & 56 deletions src/React.res
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,25 @@ external useReducerWithMapState: (
external useEffectOnEveryRender: (@uncurry (unit => option<unit => unit>)) => unit = "useEffect"
@module("react")
external useEffect: (@uncurry (unit => option<unit => unit>), 'deps) => unit = "useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
"useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit = "useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit = "useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit = "useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
"useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect5: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
"useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect6: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e, 'f)) => unit =
"useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect7: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f, 'g),
Expand All @@ -190,30 +190,30 @@ external useLayoutEffectOnEveryRender: (@uncurry (unit => option<unit => unit>))
@module("react")
external useLayoutEffect: (@uncurry (unit => option<unit => unit>), 'deps) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect5: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect6: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f),
) => unit = "useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect7: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f, 'g),
Expand All @@ -222,55 +222,55 @@ external useLayoutEffect7: (
@module("react")
external useMemo: (@uncurry (unit => 'any), 'deps) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo0: (@uncurry (unit => 'any), @as(json`[]`) _) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo1: (@uncurry (unit => 'any), array<'a>) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo2: (@uncurry (unit => 'any), ('a, 'b)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo3: (@uncurry (unit => 'any), ('a, 'b, 'c)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo4: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo5: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo6: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo7: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'any = "useMemo"

@module("react")
external useCallback: ('f, 'deps) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback0: ('f, @as(json`[]`) _) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback1: ('f, array<'a>) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback2: ('f, ('a, 'b)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback3: ('f, ('a, 'b, 'c)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback4: ('f, ('a, 'b, 'c, 'd)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback5: ('f, ('a, 'b, 'c, 'd, 'e)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback6: ('callback, ('a, 'b, 'c, 'd, 'e, 'f)) => 'callback = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback7: ('callback, ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'callback = "useCallback"

@module("react")
Expand All @@ -292,63 +292,55 @@ external useImperativeHandle: (
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle0: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
@as(json`[]`) _,
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle1: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
array<'a>,
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle2: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle3: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b, 'c),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle4: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b, 'c, 'd),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle5: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b, 'c, 'd, 'e),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle6: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b, 'c, 'd, 'e, 'f),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle7: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
Expand All @@ -369,39 +361,31 @@ external useInsertionEffectOnEveryRender: (@uncurry (unit => option<unit => unit
external useInsertionEffect: (@uncurry (unit => option<unit => unit>), 'deps) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect5: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e),
) => unit = "useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect6: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f),
) => unit = "useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect7: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f, 'g),
Expand Down Expand Up @@ -441,28 +425,28 @@ module Uncurried = {
@module("react")
external useCallback: ('f, 'deps) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback0: ('f, @as(json`[]`) _) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback1: ('f, array<'a>) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback2: ('f, ('a, 'b)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback3: ('f, ('a, 'b, 'c)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback4: ('f, ('a, 'b, 'c, 'd)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback5: ('f, ('a, 'b, 'c, 'd, 'e)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback6: ('callback, ('a, 'b, 'c, 'd, 'e, 'f)) => 'callback = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback7: ('callback, ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'callback = "useCallback"
}

Expand Down
2 changes: 1 addition & 1 deletion src/RescriptReactRouter.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7405e5e

Please sign in to comment.