Skip to content

Commit f49a463

Browse files
Keep useTransition backward compatibility
1 parent 056ce1c commit f49a463

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/React.res

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,17 @@ external displayName: component<'props> => option<string> = "displayName"
411411

412412
// Actions
413413

414-
type transitionFunction = unit => promise<unit>
415-
414+
type transitionFunction = unit => unit
416415
type transitionStartFunction = transitionFunction => unit
417416

417+
type transitionFunctionAsync = unit => promise<unit>
418+
type transitionStartFunctionAsync = transitionFunctionAsync => unit
419+
418420
/** `useTransition` is a React Hook that lets you render a part of the UI in the background. */
419421
@module("react")
420422
external useTransition: unit => (bool, transitionStartFunction) = "useTransition"
423+
@module("react")
424+
external useTransitionAsync: unit => (bool, transitionStartFunctionAsync) = "useTransition"
421425

422426
type action<'state, 'payload> = ('state, 'payload) => promise<'state>
423427

0 commit comments

Comments
 (0)