Skip to content

Commit 39f7828

Browse files
Yamin YassinYamin Yassin
authored andcommitted
Use public unstable_TextAncestorContext API
React Native 0.81 exposed TextAncestorContext as a public API (react/react-native#52368). Switch from the deep import path 'react-native/Libraries/Text/TextAncestor' to the public 'unstable_TextAncestorContext' export. The deep-import target file in React Native exists solely as a backwards-compatibility shim for react-strict-dom — see https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Text/TextAncestor.js which carries a TODO from @huntie to delete it once this cross-repo reference is fixed. Same React Context object, no behavioral change. Test mock updated to match the new import path; old deep-import mock deleted.
1 parent 07d1623 commit 39f7828

3 files changed

Lines changed: 3 additions & 11 deletions

File tree

packages/react-strict-dom/src/native/react-native/TextAncestorContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
* @flow strict-local
88
*/
99

10-
import TextAncestorContext from 'react-native/Libraries/Text/TextAncestor';
10+
import { unstable_TextAncestorContext as TextAncestorContext } from 'react-native';
1111
export { TextAncestorContext };

packages/react-strict-dom/tests/__mocks__/react-native/Libraries/Text/TextAncestor.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/react-strict-dom/tests/__mocks__/react-native/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ export const View = 'View';
120120

121121
export const experimental_LayoutConformance = 'LayoutConformance';
122122

123+
export const unstable_TextAncestorContext = 'TextAncestorContext';
124+
123125
export const useColorScheme = jest.fn().mockReturnValue('light');
124126

125127
export const useWindowDimensions = jest

0 commit comments

Comments
 (0)