-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow] Normalize
React.AbstractComponent
to the new component type,…
… with best effort flattening Summary: We want to one day kill `React.AbstractComponent`, since it's instance targ is not in-line with react 19's model of ref as a prop. People learn what types to write from hover, so it's important that we stop printing out these types. In this diff, we star to normalize React.AbstractComponent to the new component type, which is enabled regardless of whether component syntax is enabled. We have the following baseline strategy: 1. Props go into `component(...Props)` 2. Instance go into `component(ref: React.RefSetter<Instance>)` 3. Renders go into `component() renders Renders` For props, we also do some best effort flattening if the props have an object type that we can see in normalizer. For exact objects, it's straightforward; for inexact objects, we add `...{...}` at the end. We bail out on things like getters, methods, etc. For renders, we won't repeat the `render` keyword if the `Renders` already has a render type. Changelog: [ide] On hover, values that have `React.AbstractComponent` type will be shown in the [component type](https://flow.org/en/docs/react/component-types/) syntax. Reviewed By: jbrown215 Differential Revision: D62917950 fbshipit-source-id: 2464a9baf253219ed2dfb90e6ae9dc0bf6b79687
- Loading branch information
1 parent
c0c9e46
commit dd825da
Showing
13 changed files
with
319 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.