@types/react
Advanced tools
Comparing version 18.2.72 to 18.2.73
@@ -105,6 +105,6 @@ /** | ||
function useOptimistic<State>( | ||
export function useOptimistic<State>( | ||
passthrough: State, | ||
): [State, (action: State | ((pendingState: State) => State)) => void]; | ||
function useOptimistic<State, Action>( | ||
export function useOptimistic<State, Action>( | ||
passthrough: State, | ||
@@ -117,2 +117,13 @@ reducer: (state: State, action: Action) => State, | ||
} | ||
export function useActionState<State>( | ||
action: (state: Awaited<State>) => State | Promise<State>, | ||
initialState: Awaited<State>, | ||
permalink?: string, | ||
): [state: Awaited<State>, dispatch: () => void, isPending: boolean]; | ||
export function useActionState<State, Payload>( | ||
action: (state: Awaited<State>, payload: Payload) => State | Promise<State>, | ||
initialState: Awaited<State>, | ||
permalink?: string, | ||
): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean]; | ||
} |
{ | ||
"name": "@types/react", | ||
"version": "18.2.72", | ||
"version": "18.2.73", | ||
"description": "TypeScript definitions for react", | ||
@@ -208,4 +208,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react", | ||
}, | ||
"typesPublisherContentHash": "5df9233c804ceaab7414ae8685fa2b1f5235e52cabd99df03c17b2375ecee68c", | ||
"typesPublisherContentHash": "9fb5bfea6e75766d22ab76ce27297701d372335892b8ce75ad990b3103e2155c", | ||
"typeScriptVersion": "4.7" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 26 Mar 2024 18:35:47 GMT | ||
* Last updated: Wed, 27 Mar 2024 16:37:53 GMT | ||
* Dependencies: [@types/prop-types](https://npmjs.com/package/@types/prop-types), [csstype](https://npmjs.com/package/csstype) | ||
@@ -14,0 +14,0 @@ |
@@ -105,6 +105,6 @@ /** | ||
function useOptimistic<State>( | ||
export function useOptimistic<State>( | ||
passthrough: State, | ||
): [State, (action: State | ((pendingState: State) => State)) => void]; | ||
function useOptimistic<State, Action>( | ||
export function useOptimistic<State, Action>( | ||
passthrough: State, | ||
@@ -117,2 +117,13 @@ reducer: (state: State, action: Action) => State, | ||
} | ||
export function useActionState<State>( | ||
action: (state: Awaited<State>) => State | Promise<State>, | ||
initialState: Awaited<State>, | ||
permalink?: string, | ||
): [state: Awaited<State>, dispatch: () => void, isPending: boolean]; | ||
export function useActionState<State, Payload>( | ||
action: (state: Awaited<State>, payload: Payload) => State | Promise<State>, | ||
initialState: Awaited<State>, | ||
permalink?: string, | ||
): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean]; | ||
} |
431012
9305
8