From e34a038a754b3aeacdb5a45dce90341243f33436 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Tue, 19 Nov 2024 11:37:48 +0100 Subject: [PATCH] Turn useState initializer as a uncurried fn --- src/React.re | 3 ++- src/React.rei | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/React.re b/src/React.re index ba02b4222..e17931519 100644 --- a/src/React.re +++ b/src/React.re @@ -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"] diff --git a/src/React.rei b/src/React.rei index 372337618..2fac4bd03 100644 --- a/src/React.rei +++ b/src/React.rei @@ -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"]