( create: () => (() => void) | void, deps: Array<mixed> | void | null, )
| 85 | } |
| 86 | |
| 87 | export function useEffect( |
| 88 | create: () => (() => void) | void, |
| 89 | deps: Array<mixed> | void | null, |
| 90 | ): void { |
| 91 | if (__DEV__) { |
| 92 | if (create == null) { |
| 93 | console.warn( |
| 94 | 'React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?', |
| 95 | ); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | const dispatcher = resolveDispatcher(); |
| 100 | return dispatcher.useEffect(create, deps); |
| 101 | } |
| 102 | |
| 103 | export function useInsertionEffect( |
| 104 | create: () => (() => void) | void, |