Skip to content

Commit

Permalink
Remove unnecessary falsey check from debug
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Oct 28, 2019
1 parent b895ac8 commit 39d1271
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compat/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ function setSafeDescriptor(proto, key) {
Object.defineProperty(proto, key, {
configurable: false,
get() { return this['UNSAFE_' + key]; },
// This set is only used if a user sets an a lifecycle like cWU
// This `set` is only used if a user sets a lifecycle like cWU
// after setting a lifecycle like UNSAFE_cWU. I doubt anyone
// actually does this in practice so not testing it
/* istanbul ignore next */
Expand Down
6 changes: 3 additions & 3 deletions debug/src/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export function initDebug() {

if (vnode._component && vnode._component.__hooks) {
let hooks = vnode._component.__hooks;
if (hooks._list && Array.isArray(hooks._list)) {
if (Array.isArray(hooks._list)) {
hooks._list.forEach(hook => {
if (hook._callback && (!hook._args || !Array.isArray(hook._args))) {
console.warn(
Expand All @@ -237,7 +237,7 @@ export function initDebug() {
}
});
}
if (hooks._pendingEffects && Array.isArray(hooks._pendingEffects)) {
if (Array.isArray(hooks._pendingEffects)) {
hooks._pendingEffects.forEach((effect) => {
if ((!effect._args || !Array.isArray(effect._args)) && !warnedComponents.useEffect[vnode.type]) {
warnedComponents.useEffect[vnode.type] = true;
Expand All @@ -247,7 +247,7 @@ export function initDebug() {
}
});
}
if (hooks._pendingLayoutEffects && Array.isArray(hooks._pendingLayoutEffects)) {
if (Array.isArray(hooks._pendingLayoutEffects)) {
hooks._pendingLayoutEffects.forEach((layoutEffect) => {
if ((!layoutEffect._args || !Array.isArray(layoutEffect._args)) && !warnedComponents.useLayoutEffect[vnode.type]) {
warnedComponents.useLayoutEffect[vnode.type] = true;
Expand Down

0 comments on commit 39d1271

Please sign in to comment.