File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
react-reconciler/src/__tests__ Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1- const { REACT_MEMO_CACHE_SENTINEL } = require ( 'shared/ReactSymbols' ) ;
1+ /**
2+ * Copyright (c) Facebook, Inc. and its affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ *
7+ * @emails react-core
8+ * @jest -environment node
9+ */
210
311let React ;
412let ReactNoop ;
513let act ;
614let useState ;
715let useMemoCache ;
16+ let MemoCacheSentinel ;
817let ErrorBoundary ;
918
1019describe ( 'useMemoCache()' , ( ) => {
@@ -16,6 +25,7 @@ describe('useMemoCache()', () => {
1625 act = require ( 'jest-react' ) . act ;
1726 useState = React . useState ;
1827 useMemoCache = React . unstable_useMemoCache ;
28+ MemoCacheSentinel = Symbol . for ( 'react.memo_cache_sentinel' ) ;
1929
2030 class _ErrorBoundary extends React . Component {
2131 constructor ( props ) {
@@ -48,7 +58,8 @@ describe('useMemoCache()', () => {
4858 const cache = useMemoCache ( 1 ) ;
4959 expect ( Array . isArray ( cache ) ) . toBe ( true ) ;
5060 expect ( cache . length ) . toBe ( 1 ) ;
51- expect ( cache [ 0 ] ) . toBe ( REACT_MEMO_CACHE_SENTINEL ) ;
61+ expect ( cache [ 0 ] ) . toBe ( MemoCacheSentinel ) ;
62+
5263 return 'Ok' ;
5364 }
5465 const root = ReactNoop . createRoot ( ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import {
2020 REACT_SCOPE_TYPE ,
2121 REACT_CACHE_TYPE ,
2222 REACT_TRACING_MARKER_TYPE ,
23- REACT_MEMO_CACHE_SENTINEL ,
2423} from 'shared/ReactSymbols' ;
2524
2625import { Component , PureComponent } from './ReactBaseClasses' ;
@@ -140,7 +139,6 @@ export {
140139 REACT_CACHE_TYPE as unstable_Cache ,
141140 use as experimental_use ,
142141 useMemoCache as unstable_useMemoCache ,
143- REACT_MEMO_CACHE_SENTINEL as unstable_MemoCacheSentinel ,
144142 // enableScopeAPI
145143 REACT_SCOPE_TYPE as unstable_Scope ,
146144 // enableTransitionTracing
You can’t perform that action at this time.
0 commit comments