Skip to content

Commit

Permalink
[nit] Remove redundant 20517typeof check
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeiZ committed Sep 9, 2022
1 parent 197184f commit 92e196c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
5 changes: 2 additions & 3 deletions packages/react-reconciler/src/ReactFiberHooks.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,8 @@ function use<T>(usable: Usable<T>): T {
}
}
} else if (
usable.$$typeof != null &&
(usable.$$typeof === REACT_CONTEXT_TYPE ||
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE)
usable.$$typeof === REACT_CONTEXT_TYPE ||
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE
) {
const context: ReactContext<T> = (usable: any);
return readContext(context);
Expand Down
5 changes: 2 additions & 3 deletions packages/react-reconciler/src/ReactFiberHooks.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,8 @@ function use<T>(usable: Usable<T>): T {
}
}
} else if (
usable.$$typeof != null &&
(usable.$$typeof === REACT_CONTEXT_TYPE ||
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE)
usable.$$typeof === REACT_CONTEXT_TYPE ||
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE
) {
const context: ReactContext<T> = (usable: any);
return readContext(context);
Expand Down
5 changes: 2 additions & 3 deletions packages/react-server/src/ReactFizzHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,8 @@ function use<T>(usable: Usable<T>): T {
}
}
} else if (
usable.$$typeof != null &&
(usable.$$typeof === REACT_CONTEXT_TYPE ||
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE)
usable.$$typeof === REACT_CONTEXT_TYPE ||
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE
) {
const context: ReactContext<T> = (usable: any);
return readContext(context);
Expand Down
5 changes: 1 addition & 4 deletions packages/react-server/src/ReactFlightHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ function use<T>(usable: Usable<T>): T {
}
}
}
} else if (
usable.$$typeof != null &&
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE
) {
} else if (usable.$$typeof === REACT_SERVER_CONTEXT_TYPE) {
const context: ReactServerContext<T> = (usable: any);
return readContext(context);
}
Expand Down

0 comments on commit 92e196c

Please sign in to comment.