Skip to content

Commit f932f34

Browse files
committed
Simplify useEffectEvent types
1 parent 048d91b commit f932f34

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/react-reconciler/src/ReactInternalTypes.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,7 @@ export type Dispatcher = {
383383
create: () => (() => void) | void,
384384
deps: Array<mixed> | void | null,
385385
): void,
386-
useEffectEvent?: <Args, Return, F: (...Array<Args>) => Return>(
387-
callback: F,
388-
) => F,
386+
useEffectEvent?: <Args, F: (...Array<Args>) => mixed>(callback: F) => F,
389387
useInsertionEffect(
390388
create: () => (() => void) | void,
391389
deps: Array<mixed> | void | null,

packages/react/src/ReactHooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export function useMemoCache(size: number): Array<any> {
234234
return dispatcher.useMemoCache(size);
235235
}
236236

237-
export function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(
237+
export function useEffectEvent<Args, F: (...Array<Args>) => mixed>(
238238
callback: F,
239239
): F {
240240
const dispatcher = resolveDispatcher();

0 commit comments

Comments
 (0)