Forward port away from deprecated React.ElementRef to React.ComponentRef - #54274
Forward port away from deprecated React.ElementRef to React.ComponentRef#54274mikehardy wants to merge 1 commit into
Conversation
7e9c966 to
af65324
Compare
|
There was a linting error in my diff, I fixed that and re-pushed. The android build error is some deprecation warnings while -Werror is passed, not part of this PR |
cipolleschi
left a comment
There was a problem hiding this comment.
Thanks @mikehardy for fixing this!
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D85556329. |
|
I believe the ComponentRef changes are specific to TypeScript, so no code under |
|
@javache oh interesting! I am unfamiliar with flow types and assumed they would be similar, I'll focus this change on typescript when I get a chance / removing the flow bits then and re-push. Thanks for catching that |
- Note Typescript has this chance, Flow does not have ComponentRef type, so this is typescript-only and Flow did not need a similar change
af65324 to
4271a9c
Compare
|
Okay, @cipolleschi - after Pieter's astute observation that this should be typescript-only since Flow does not have a corresponding change, I have re-pushed this with changes only to the typescript codegen parser + test fixtures + test snapshots. I believe that means you need to reimport? |
|
@cipolleschi merged this pull request in abd3bfb. |
|
This pull request was successfully merged by @mikehardy in abd3bfb When will my fix make it into a release? | How to file a pick request? |
…Ref (#54274) Summary: React v19 deprecated React.ElementRef and recommends using React.ComponentRef This appears to work just fine, with no other changes other than the type, with the exception of the Codegen phase which makes no allowance for ComponentRef during parsing I altered the typescript and flow parsers to accept the new ComponentRef as well as the old ElementRef - Fixes react/react-native#54272 ## Changelog: [INTERNAL][DEPRECATED] - use React.ComponentRef in codegen in place of React.ElementRef Pull Request resolved: react/react-native#54274 Test Plan: This is mostly checked in jest tests, I updated the fixtures to send ComponentRef through, and I updated the snapshots to expect a message that indicates either ElementRef or ComponentRef are expected Reviewed By: javache Differential Revision: D85556329 Pulled By: cipolleschi fbshipit-source-id: 0ca4e3929743746da0bde1bfb0e05500db0594f7
Summary:
React v19 deprecated React.ElementRef and recommends using React.ComponentRef
This appears to work just fine, with no other changes other than the type, with the exception of the Codegen phase which makes no allowance for ComponentRef during parsing
I altered the typescript and flow parsers to accept the new ComponentRef as well as the old ElementRef
Changelog:
[INTERNAL][DEPRECATED] - use React.ComponentRef in codegen in place of React.ElementRef
Test Plan:
This is mostly checked in jest tests, I updated the fixtures to send ComponentRef through, and I updated the snapshots to expect a message that indicates either ElementRef or ComponentRef are expected