Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/React.res
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,22 @@ external displayName: component<'props> => option<string> = "displayName"

// Actions

type transitionFunction = unit => promise<unit>
type transitionFunction = unit => unit

type transitionStartFunction = transitionFunction => unit

/** `useTransition` is a React Hook that lets you render a part of the UI in the background. */
@module("react")
external useTransition: unit => (bool, transitionStartFunction) = "useTransition"

type transitionAsyncFunction = unit => promise<unit>

type transitionAsyncStartFunction = transitionAsyncFunction => unit

/** `useTransitionAsync` is a React Hook that lets you render a part of the UI in the background. */
@module("react")
external useTransitionAsync: unit => (bool, transitionAsyncStartFunction) = "useTransition"

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

type formAction<'formData> = 'formData => promise<unit>
Expand Down