diff --git a/src/visitor.js b/src/visitor.js index 7da6bac..16d2439 100644 --- a/src/visitor.js +++ b/src/visitor.js @@ -81,10 +81,13 @@ import { import { isClientReference } from './utils' -const { ReactCurrentDispatcher } = +const REACT_INTERNALS = (React: any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED || (React: any).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE +const ReactCurrentDispatcher = + REACT_INTERNALS && REACT_INTERNALS.ReactCurrentDispatcher + // In the presence of setImmediate, i.e. on Node, we'll enable the // yielding behavior that gives the event loop a chance to continue // running when the prepasses would otherwise take too long