File tree Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ function useRef<T>(initialValue: T): {current: T} {
142
142
}
143
143
144
144
function useLayoutEffect(
145
- create: () => mixed ,
145
+ create: () => ( ( ) => void ) | void ,
146
146
inputs : Array < mixed > | void | null,
147
147
): void {
148
148
nextHook ( ) ;
@@ -154,7 +154,7 @@ function useLayoutEffect(
154
154
}
155
155
156
156
function useEffect(
157
- create: () => mixed ,
157
+ create: () => ( ( ) => void ) | void ,
158
158
inputs : Array < mixed > | void | null,
159
159
): void {
160
160
nextHook ( ) ;
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ function useRef<T>(initialValue: T): {current: T} {
329
329
}
330
330
331
331
export function useLayoutEffect (
332
- create : ( ) => mixed ,
332
+ create : ( ) => ( ( ) => void ) | void ,
333
333
inputs : Array < mixed > | void | null,
334
334
) {
335
335
if ( __DEV__ ) {
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ export type Hook = {
66
66
67
67
type Effect = {
68
68
tag : HookEffectTag ,
69
- create : ( ) => mixed ,
70
- destroy : ( ( ) => mixed ) | null ,
69
+ create : ( ) => ( ( ) => void ) | void ,
70
+ destroy : ( ( ) => void ) | null ,
71
71
deps : Array < mixed > | null ,
72
72
next : Effect ,
73
73
} ;
@@ -608,7 +608,7 @@ export function useRef<T>(initialValue: T): {current: T} {
608
608
}
609
609
610
610
export function useLayoutEffect (
611
- create : ( ) => mixed ,
611
+ create : ( ) => ( ( ) => void ) | void ,
612
612
deps : Array < mixed > | void | null,
613
613
): void {
614
614
if ( __DEV__ ) {
@@ -618,7 +618,7 @@ export function useLayoutEffect(
618
618
}
619
619
620
620
export function useEffect (
621
- create : ( ) => mixed ,
621
+ create : ( ) => ( ( ) => void ) | void ,
622
622
deps : Array < mixed > | void | null,
623
623
): void {
624
624
if ( __DEV__ ) {
@@ -679,7 +679,9 @@ export function useImperativeHandle<T>(
679
679
const refCallback = ref ;
680
680
const inst = create ( ) ;
681
681
refCallback ( inst ) ;
682
- return ( ) => refCallback ( null ) ;
682
+ return ( ) => {
683
+ refCallback ( null ) ;
684
+ } ;
683
685
} else if ( ref !== null && ref !== undefined ) {
684
686
const refObject = ref ;
685
687
const inst = create ( ) ;
Original file line number Diff line number Diff line change @@ -71,15 +71,15 @@ export function useRef<T>(initialValue: T): {current: T} {
71
71
}
72
72
73
73
export function useEffect(
74
- create: () => mixed ,
74
+ create: () => ( ( ) => void ) | void ,
75
75
inputs : Array < mixed > | void | null ,
76
76
) {
77
77
const dispatcher = resolveDispatcher ( ) ;
78
78
return dispatcher . useEffect ( create , inputs ) ;
79
79
}
80
80
81
81
export function useLayoutEffect (
82
- create: () => mixed ,
82
+ create : ( ) = > ( ( ) => void ) | void ,
83
83
inputs : Array < mixed > | void | null ,
84
84
) {
85
85
const dispatcher = resolveDispatcher ( ) ;
You can’t perform that action at this time.
0 commit comments