Skip to content

Commit

Permalink
Removed DEV warnings; they didn't follow precedent set by other hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Feb 7, 2020
1 parent 876dd7c commit 560acda
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions packages/react-reconciler/src/ReactFiberHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,40 +865,8 @@ function useMutableSourceImpl<S>(
source: MutableSource,
config: MutableSourceHookConfig<S>,
): S {
if (__DEV__) {
if (typeof config !== 'object' || config === null) {
console.error(
'Expected useMutableSource() second argument to be a config object. ' +
'Instead received: %s.',
config === null ? 'null' : typeof config,
);
}
}

const {getSnapshot, getVersion, subscribe} = config;
if (__DEV__) {
if (
typeof getSnapshot !== 'function' ||
typeof getVersion !== 'function' ||
typeof subscribe !== 'function'
) {
console.error(
'Invalid useMutableSource() config specified. ' +
'Config object should define getSnapshot, getVersion, and subscribe methods. ' +
'See https://fb.me/useMutableSource for more information.',
);
}
}

const version = getVersion();
if (__DEV__) {
if (version == null) {
console.error(
'useMutableSource() version should not be null or undefined.',
);
}
}

const pendingExpirationTime = getMutableSourcePendingExpirationTime(source);

let isSafeToReadFromSource = false;
Expand Down

0 comments on commit 560acda

Please sign in to comment.