Repository navigation
Conversation
View copies its props and checks 17 keys on every render to map aria-*, id and tabIndex onto their native equivalents. Most Views pass none of them, so check first and pass props through unchanged in that case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shubh73
force-pushed
the
view-props-fast-path
branch
from
October 15, 2026 10:25
c30e425 to
4f7fee2
Compare
Parses View.js and checks that `needsPropTransforms` reads exactly the keys `transformProps` destructures, so adding a transform without updating the check fails instead of silently skipping it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shubh73
marked this pull request as ready for review
October 15, 2026 10:50
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Viewcopies its props and runs about 15 checks on every render to maparia-*,idandtabIndexonto their native equivalents. Most Views set none of these, so this checks the 17 keys first and, if none is set, passes props straight toViewNativeComponent. Views that set any of them take the existing path, unchanged.The transforms stay in JS, where #56699 left them; this only skips them when there's nothing to transform. A new test fails if the keys
needsPropTransformschecks drift from the onestransformPropsreads.Native props are unchanged. On device, I recorded every payload sent to
createNode/cloneNodeWithNewProps, before and after, across 2,516 random mount/update steps: keys and values match in every step. In 3 updates, a removed key appears in a different position; native reads props by name, so this isn't observable.Fantom (
View-propTransforms-benchmark-itest.js, release tester, 100 Views, median of 5 runs)testID+pointerEventsaria-labelaria-labelaccessibilityStateThe existing
View-vs-ViewNativeComponentbenchmark goes from 527 µs to 468 µs (-11.2%).Device (OPPO CPH2667, Dimensity 6300, RNTester release build, 500–600 Views, median of 3 × 100 runs)
testID+pointerEvents+hitSloptestID+pointerEvents+hitSloparia-labelaria-labelaccessibilityState+accessibilityValueaccessibilityState+accessibilityValueDevice times are JS-thread time for the whole update, including commit and layout, so the relative change is smaller than in Fantom. That's 1.2–3.9 µs saved per View.
Changelog:
[GENERAL] [CHANGED] - Skip
Viewprop transforms when noaria-*,idortabIndexprops are passedTest Plan:
yarn test packages/react-native: 5241 passed, including the newView-propTransforms-test.yarn fantom packages/react-native/Libraries/Components/View: 259 passed.yarn flow-check, ESLint, Prettier: clean.View(not committed): ~25k prop combinations, comparing iOS and Android create and diff payloads. All match.mainvs. this branch), plusuiautomatordumps of RNTester's Accessibility and View examples. The same 617 accessibility nodes before and after.🤖 Generated with Claude Code