Skip to content

Commit

Permalink
Turn useState initializer as a uncurried fn
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Nov 19, 2024
1 parent 4434bfd commit e34a038
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/React.re
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ type callbackAsync('input, 'output) = 'input => Js.Promise.t('output);
*/
[@mel.module "react"]
external useState:
([@mel.uncurry] (unit => 'state)) => ('state, ('state => 'state) => unit) =
([@mel.uncurry] (unit => 'state)) =>
('state, (. ('state => 'state)) => unit) =
"useState";

[@mel.module "react"]
Expand Down
3 changes: 2 additions & 1 deletion src/React.rei
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ module Suspense: {
*/
[@mel.module "react"]
external useState:
([@mel.uncurry] (unit => 'state)) => ('state, ('state => 'state) => unit) =
([@mel.uncurry] (unit => 'state)) =>
('state, (. ('state => 'state)) => unit) =
"useState";

[@mel.module "react"]
Expand Down

0 comments on commit e34a038

Please sign in to comment.