Skip to content

Commit 5a59161

Browse files
Freddy03hcknitt
authored andcommitted
useOptimistic optionnal updateFn
1 parent 1106232 commit 5a59161

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/React.res

+4-2
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,10 @@ external useActionState: (
433433

434434
/** `useOptimistic` is a React Hook that lets you optimistically update the UI. */
435435
@module("react")
436-
external useOptimistic: ('state, ('state, 'action) => 'state) => ('state, 'action => unit) =
437-
"useOptimistic"
436+
external useOptimistic: (
437+
'state,
438+
~updateFn: ('state, 'action) => 'state=?,
439+
) => ('state, 'action => unit) = "useOptimistic"
438440

439441
/** `act` is a test helper to apply pending React updates before making assertions. */
440442
@module("react")

0 commit comments

Comments
 (0)