Skip to content

Commit 0f04665

Browse files
committed
React.useOptimistic
1 parent fddcca6 commit 0f04665

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/React.res

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,3 +425,8 @@ external useActionState: (
425425
'state,
426426
~permalink: string=?,
427427
) => ('state, formAction<'payload>, bool) = "useActionState"
428+
429+
/** `useOptimistic` is a React Hook that lets you optimistically update the UI. */
430+
@module("react")
431+
external useOptimistic: ('state, ('state, 'action) => 'state) => ('state, 'action => unit) =
432+
"useOptimistic"

0 commit comments

Comments
 (0)