Skip to content

Destructure all overridden props#44910

Closed
pieterv wants to merge 2 commits into
facebook:mainfrom
pieterv:export-D58446569
Closed

Destructure all overridden props#44910
pieterv wants to merge 2 commits into
facebook:mainfrom
pieterv:export-D58446569

Conversation

@pieterv
Copy link
Copy Markdown
Member

@pieterv pieterv commented Jun 12, 2024

Summary:
Props within the Text component are accessed both via destructuring the props object but also in some cases by using a "dot" access on the destructured restProps. However in all of the "dot" access cases the property is being overrided. Which means in the final JSX these properties get set twice, e.g. via the restProps spread then overrrided by static properties. This change just destructures all values to avoid this inefficiency.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58446569

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jun 12, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D58446569

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 20,364,313 +31
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 23,569,592 +65
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 18be49e
Branch: main

pieterv and others added 2 commits June 12, 2024 16:33
Differential Revision: D58391419
Summary:
Pull Request resolved: facebook#44910

Props within the `Text` component are accessed both via destructuring the props object but also in some cases by using a "dot" access on the destructured `restProps`. However in all of the "dot" access cases the property is being overrided. Which means in the final JSX these properties get set twice, e.g. via the `restProps` spread then overrrided by static properties. This change just destructures all values to avoid this inefficiency.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58446569
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D58446569

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in a237e8d.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 13, 2024
@github-actions
Copy link
Copy Markdown

This pull request was successfully merged by @pieterv in a237e8d.

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants