Skip to content

Fix incorrect usage of React.ElementConfig and React.ElementRef in xplat#37083

Closed
SamChou19815 wants to merge 1 commit into
facebook:mainfrom
SamChou19815:export-D44774275
Closed

Fix incorrect usage of React.ElementConfig and React.ElementRef in xplat#37083
SamChou19815 wants to merge 1 commit into
facebook:mainfrom
SamChou19815:export-D44774275

Conversation

@SamChou19815
Copy link
Copy Markdown
Contributor

Summary:
React.ElementConfig<a polymophic type> will result in unpredictable behavior in Flow due to some types being unresolved. Since the type is already broken in most cases, I use $FlowFixMe as the type for those type arguments that are currently inferred as empty.

Changelog: [Internal]

Differential Revision: D44774275

@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 fb-exported labels Apr 25, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 25, 2023

Warnings
⚠️

packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js#L285 - packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js line 285 – Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “SectionList_scrollable” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true. (react/no-unstable-nested-components)

⚠️

packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js#L289 - packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js line 289 – Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “SectionList_scrollable” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true. (react/no-unstable-nested-components)

Generated by 🚫 dangerJS against 893008b

@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Apr 25, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,625,234 +0
android hermes armeabi-v7a 7,937,961 +0
android hermes x86 9,112,304 +0
android hermes x86_64 8,967,010 +0
android jsc arm64-v8a 9,189,282 +0
android jsc armeabi-v7a 8,379,453 +0
android jsc x86 9,247,701 +0
android jsc x86_64 9,506,049 +0

Base commit: b4466c7
Branch: main

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

…lat (#37083)

Summary:
Pull Request resolved: #37083

`React.ElementConfig<a polymophic type>` will result in unpredictable behavior in Flow due to some types being unresolved. Since the type is already broken in most cases, I use $FlowFixMe as the type for those type arguments that are currently inferred as empty.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D44774275

fbshipit-source-id: 440b6c731fa28f40a7246883ab32f2a4d78f9cd1
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Apr 26, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 0e59e2a.

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