Replace deprecated ElementRef with ComponentRef - #100679
Draft
KJ21-ENG wants to merge 1 commit into
Draft
Conversation
Seatbelt-Operation: s08-ead3e0b9-00c6c5f-sign-1
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.
Explanation of Change
This replaces React's deprecated type-only
ElementRefalias with its exactComponentRefreplacement. The optional parameter, native host component, HTML/SVG ref intersection, web focus call, and native accessibility-focus call are unchanged. The shared contract remains the same, and neither alias emits JavaScript.The only changed file is
src/libs/Accessibility/moveAccessibilityFocus/types.ts.Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
ElementRef<C>resolves toComponentRef<C>, and both versions emit the same empty JavaScript module.moveAccessibilityFocusinstead of exercising this type contract.Limitations: the focused TypeScript run retained 43 diagnostics outside the changed root. No runtime, manual, device, offline, all-platform, or console QA was performed.
Offline tests
Not applicable. This type-only cleanup changes no requests or offline behavior; offline testing was not performed.
QA Steps
On macOS Chrome in staging, sign in with an account that can access Workspaces and Domains, then open Workspaces > Domains > Add domain. Leave Domain name blank and press Continue; when the validation alert appears, click "fix the errors" and verify focus returns to the Domain name input while its required-field error remains visible. Check the JS console for errors. This action follows the production
FormWrapperfocus path and is recommended but has not been performed. Native screen-reader focus remains unverified.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Not applicable. This cleanup has no visual effect, and no screenshots or videos were produced.