Skip to content

Commit e2e0700

Browse files
committed
nits
1 parent 71d5352 commit e2e0700

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/react-cache/src/ReactCache.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,16 @@ const Pending = 0;
4646
const Resolved = 1;
4747
const Rejected = 2;
4848

49+
const currentOwner =
50+
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
51+
4952
function readContext(Context, observedBits) {
50-
const dispatcher =
51-
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner
52-
.currentDispatcher;
53+
const dispatcher = currentOwner.currentDispatcher;
5354
if (dispatcher === null) {
5455
throw new Error(
5556
'react-cache: read and preload may only be called from within a ' +
5657
"component's render. They are not supported in event handlers or " +
57-
'life-cycles.',
58+
'lifecycle methods.',
5859
);
5960
}
6061
return dispatcher.readContext(Context, observedBits);

packages/react-cache/src/__tests__/ReactCache-test.internal.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ describe('ReactCache', () => {
4444
ReactFeatureFlags = require('shared/ReactFeatureFlags');
4545
ReactFeatureFlags.debugRenderPhaseSideEffectsForStrictMode = false;
4646
ReactFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
47-
ReactFeatureFlags.enableSuspense = true;
4847
React = require('react');
4948
Suspense = React.unstable_Suspense;
5049
ReactCache = require('react-cache');

0 commit comments

Comments
 (0)