Skip to content

Commit 16b11dc

Browse files
committed
React.useTransition
1 parent d8143bf commit 16b11dc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/React.res

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,6 @@ external useImperativeHandle7: (
312312

313313
@module("react") external useDeferredValue: 'value => 'value = "useDeferredValue"
314314

315-
@module("react")
316-
external useTransition: unit => (bool, (unit => unit) => unit) = "useTransition"
317-
318315
@module("react")
319316
external useInsertionEffectOnEveryRender: (unit => option<unit => unit>) => unit =
320317
"useInsertionEffect"
@@ -406,3 +403,13 @@ external setDisplayName: (component<'props>, string) => unit = "displayName"
406403

407404
@get @return(nullable)
408405
external displayName: component<'props> => option<string> = "displayName"
406+
407+
// Actions
408+
409+
type transitionFunction = unit => promise<unit>
410+
411+
type transitionStartFunction = transitionFunction => unit
412+
413+
/** `useTransition` is a React Hook that lets you render a part of the UI in the background. */
414+
@module("react")
415+
external useTransition: unit => (bool, transitionStartFunction) = "useTransition"

0 commit comments

Comments
 (0)