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} {
142142}
143143
144144function useLayoutEffect(
145- create: () => mixed ,
145+ create: () => ( ( ) => void ) | void ,
146146 inputs : Array < mixed > | void | null,
147147): void {
148148 nextHook ( ) ;
@@ -154,7 +154,7 @@ function useLayoutEffect(
154154}
155155
156156function useEffect(
157- create: () => mixed ,
157+ create: () => ( ( ) => void ) | void ,
158158 inputs : Array < mixed > | void | null,
159159): void {
160160 nextHook ( ) ;
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ function useRef<T>(initialValue: T): {current: T} {
329329}
330330
331331export function useLayoutEffect (
332- create : ( ) => mixed ,
332+ create : ( ) => ( ( ) => void ) | void ,
333333 inputs : Array < mixed > | void | null,
334334) {
335335 if ( __DEV__ ) {
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ export type Hook = {
6666
6767type Effect = {
6868 tag : HookEffectTag ,
69- create : ( ) => mixed ,
70- destroy : ( ( ) => mixed ) | null ,
69+ create : ( ) => ( ( ) => void ) | void ,
70+ destroy : ( ( ) => void ) | null ,
7171 deps : Array < mixed > | null ,
7272 next : Effect ,
7373} ;
@@ -608,7 +608,7 @@ export function useRef<T>(initialValue: T): {current: T} {
608608}
609609
610610export function useLayoutEffect (
611- create : ( ) => mixed ,
611+ create : ( ) => ( ( ) => void ) | void ,
612612 deps : Array < mixed > | void | null,
613613): void {
614614 if ( __DEV__ ) {
@@ -618,7 +618,7 @@ export function useLayoutEffect(
618618}
619619
620620export function useEffect (
621- create : ( ) => mixed ,
621+ create : ( ) => ( ( ) => void ) | void ,
622622 deps : Array < mixed > | void | null,
623623): void {
624624 if ( __DEV__ ) {
@@ -679,7 +679,9 @@ export function useImperativeHandle<T>(
679679 const refCallback = ref ;
680680 const inst = create ( ) ;
681681 refCallback ( inst ) ;
682- return ( ) => refCallback ( null ) ;
682+ return ( ) => {
683+ refCallback ( null ) ;
684+ } ;
683685 } else if ( ref !== null && ref !== undefined ) {
684686 const refObject = ref ;
685687 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} {
7171}
7272
7373export function useEffect(
74- create: () => mixed ,
74+ create: () => ( ( ) => void ) | void ,
7575 inputs : Array < mixed > | void | null ,
7676) {
7777 const dispatcher = resolveDispatcher ( ) ;
7878 return dispatcher . useEffect ( create , inputs ) ;
7979}
8080
8181export function useLayoutEffect (
82- create: () => mixed ,
82+ create : ( ) = > ( ( ) => void ) | void ,
8383 inputs : Array < mixed > | void | null ,
8484) {
8585 const dispatcher = resolveDispatcher ( ) ;
You can’t perform that action at this time.
0 commit comments