From 9bd9556652827ce48fbe2bde327ad41591f76da4 Mon Sep 17 00:00:00 2001 From: tsnobip Date: Wed, 2 Jul 2025 15:03:03 +0200 Subject: [PATCH] keep useTransition for sync and add an useTransitionAsync this allows to remove a breaking change from v0.14.0 --- src/React.res | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/React.res b/src/React.res index f1f6831..d056475 100644 --- a/src/React.res +++ b/src/React.res @@ -411,7 +411,7 @@ external displayName: component<'props> => option = "displayName" // Actions -type transitionFunction = unit => promise +type transitionFunction = unit => unit type transitionStartFunction = transitionFunction => unit @@ -419,6 +419,14 @@ type transitionStartFunction = transitionFunction => unit @module("react") external useTransition: unit => (bool, transitionStartFunction) = "useTransition" +type transitionAsyncFunction = unit => promise + +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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy