| 101 | } |
| 102 | |
| 103 | export function useInsertionEffect( |
| 104 | create: () => (() => void) | void, |
| 105 | deps: Array<mixed> | void | null, |
| 106 | ): void { |
| 107 | if (__DEV__) { |
| 108 | if (create == null) { |
| 109 | console.warn( |
| 110 | 'React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?', |
| 111 | ); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | const dispatcher = resolveDispatcher(); |
| 116 | return dispatcher.useInsertionEffect(create, deps); |
| 117 | } |
| 118 | |
| 119 | export function useLayoutEffect( |
| 120 | create: () => (() => void) | void, |