File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 11
11
import type { PressEvent } from '../Types/CoreEventTypes' ;
12
12
import type { TextProps } from './TextProps' ;
13
13
14
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags' ;
14
15
import * as PressabilityDebug from '../Pressability/PressabilityDebug' ;
15
16
import usePressability from '../Pressability/usePressability' ;
16
17
import flattenStyle from '../StyleSheet/flattenStyle' ;
@@ -337,4 +338,8 @@ const verticalAlignToTextAlignVerticalMap = {
337
338
middle : 'center' ,
338
339
} ;
339
340
340
- module . exports = Text ;
341
+ module . exports = (
342
+ ReactNativeFeatureFlags . shouldUseOptimizedText ( )
343
+ ? require ( './TextOptimized' )
344
+ : Text
345
+ ) as typeof Text ;
Original file line number Diff line number Diff line change @@ -8048,7 +8048,7 @@ exports[`public API should not change unintentionally Libraries/Text/Text.js 1`]
8048
8048
TextProps,
8049
8049
React.ElementRef<typeof NativeText | typeof NativeVirtualText>,
8050
8050
>;
8051
- declare module.exports: Text;
8051
+ declare module.exports: typeof Text;
8052
8052
"
8053
8053
`;
8054
8054
Original file line number Diff line number Diff line change @@ -187,6 +187,10 @@ const definitions: FeatureFlagDefinitions = {
187
187
description :
188
188
'Enables use of AnimatedObject for animating transform values.' ,
189
189
} ,
190
+ shouldUseOptimizedText : {
191
+ defaultValue : false ,
192
+ description : 'Use optimized version of <Text /> component.' ,
193
+ } ,
190
194
shouldUseRemoveClippedSubviewsAsDefaultOnIOS : {
191
195
defaultValue : false ,
192
196
description :
Original file line number Diff line number Diff line change 4
4
* This source code is licensed under the MIT license found in the
5
5
* LICENSE file in the root directory of this source tree.
6
6
*
7
- * @generated SignedSource<<edd8917cdda9c37bbe84d036f62a36ba >>
7
+ * @generated SignedSource<<522f11a571457cb932f451cf81bd384a >>
8
8
* @flow strict-local
9
9
*/
10
10
@@ -32,6 +32,7 @@ export type ReactNativeFeatureFlagsJsOnly = {
32
32
enableAccessToHostTreeInFabric : Getter < boolean > ,
33
33
isLayoutAnimationEnabled : Getter < boolean > ,
34
34
shouldUseAnimatedObjectForTransform : Getter < boolean > ,
35
+ shouldUseOptimizedText : Getter < boolean > ,
35
36
shouldUseRemoveClippedSubviewsAsDefaultOnIOS : Getter < boolean > ,
36
37
shouldUseSetNativePropsInFabric : Getter < boolean > ,
37
38
} ;
@@ -97,6 +98,11 @@ export const isLayoutAnimationEnabled: Getter<boolean> = createJavaScriptFlagGet
97
98
*/
98
99
export const shouldUseAnimatedObjectForTransform : Getter < boolean > = createJavaScriptFlagGetter ( 'shouldUseAnimatedObjectForTransform' , false ) ;
99
100
101
+ /**
102
+ * Use optimized version of <Text /> component.
103
+ */
104
+ export const shouldUseOptimizedText : Getter < boolean > = createJavaScriptFlagGetter ( 'shouldUseOptimizedText' , false ) ;
105
+
100
106
/**
101
107
* removeClippedSubviews prop will be used as the default in FlatList on iOS to match Android
102
108
*/
You can’t perform that action at this time.
0 commit comments