Skip to content

New text.windows.js code calls flatten on styles twice if not bridgeless #14038

@slswalker

Description

@slswalker

Problem Description

StyleSheet.flatten is very expensive. Running this twice on a component that can be rendered quite often without memoization is quite the perf hit. The second location doesn't look like it was ever tested because it flattens the original style, then grabs a lot of props out of that style, then does not do anything with the result. Please fix this before 0.76 stable release.

Steps To Reproduce

text.windows.js:333

Expected Results

No response

CLI version

npx @react-native-community/cli -v

Environment

npx @react-native-community/cli info

Community Modules

No response

Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

Metadata

Metadata

Assignees

Labels

Area: PaperArea: TextArea: Text Style Propshttps://reactnative.dev/docs/text-style-propsOld ArchitectureBroad category for issues that apply to the RN "old" architecture of Cxx Modules + PaperPartner: Xbox(label may be applied by bot based on author)bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions