Skip to content

Commit b19a571

Browse files
committed
fix(react-v19): Ignore ReactCurrentDispatcher not existing in react-sever conditional env
1 parent 4b15716 commit b19a571

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/visitor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,13 @@ import {
8181

8282
import { isClientReference } from './utils'
8383

84-
const { ReactCurrentDispatcher } =
84+
const REACT_INTERNALS =
8585
(React: any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ||
8686
(React: any).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
8787

88+
const ReactCurrentDispatcher =
89+
REACT_INTERNALS && REACT_INTERNALS.ReactCurrentDispatcher
90+
8891
// In the presence of setImmediate, i.e. on Node, we'll enable the
8992
// yielding behavior that gives the event loop a chance to continue
9093
// running when the prepasses would otherwise take too long

0 commit comments

Comments
 (0)