Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/react/src/ReactHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@
updateDeps?: Array<mixed> | void | null,
destroy?: ((resource: {...} | void | null) => void) | void,
): void {
if (__DEV__ && create == null) {
console.warn(

Check failure on line 97 in packages/react/src/ReactHooks.js

View workflow job for this annotation

GitHub Actions / Run eslint

Wrap console.warn() in an "if (__DEV__) {}" check
'React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?',
);
}

const dispatcher = resolveDispatcher();
if (
enableUseEffectCRUDOverload &&
Expand All @@ -118,6 +124,12 @@
create: () => (() => void) | void,
deps: Array<mixed> | void | null,
): void {
if (__DEV__ && create == null) {
console.warn(

Check failure on line 128 in packages/react/src/ReactHooks.js

View workflow job for this annotation

GitHub Actions / Run eslint

Wrap console.warn() in an "if (__DEV__) {}" check
'React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?',
);
}

const dispatcher = resolveDispatcher();
return dispatcher.useInsertionEffect(create, deps);
}
Expand All @@ -126,6 +138,12 @@
create: () => (() => void) | void,
deps: Array<mixed> | void | null,
): void {
if (__DEV__ && create == null) {
console.warn(

Check failure on line 142 in packages/react/src/ReactHooks.js

View workflow job for this annotation

GitHub Actions / Run eslint

Wrap console.warn() in an "if (__DEV__) {}" check
'React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?',
);
}

const dispatcher = resolveDispatcher();
return dispatcher.useLayoutEffect(create, deps);
}
Expand Down
Loading