-
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] Make optional ref prop in component syntax work
Summary: After the libdef change to make React.RefSetter include null and void, component syntax with optional ref prop already **almost** work. The only missing piece is the ref extraction. If we don't have this logic, `void ~> ExtractRefT` will happen first, which will taint the solution with a mixed, which explains the reason of the weird error [here](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0STMjAglAkAAIAEqsZRcmCUdJcgDkUWUooA3AAdKByyAidlfHxcgBixAAFCwYAB+ZC8-kxPkwADKuJMAB5gDBiAb7KYoAheFzMJQDcIRDd6QA+ACUXOAcq5IcN0SslIAkkqTJk4A1sAAJYFsNrazQuzUBgC8PsDwdDhZYEiElCggdtEANotFLrdBoAzPSCyHGVyANoAXT9La5xdLUFlUGb8qgGieVGwXNs9ld7BNBr54ZN5uJVptdq5Doqzrn7tdxGew59Q-HuEn0+gs4QxDYC7DyisK4tlGtlftUh3daoHuuJl9Q6WhqEB9po2bAJgd6aPSXIAPQnnKQHEKBMDgTeEBQTAMHwYBwEoeBDQQHAbBcgADNhCFQEhIE4XKuQgAm+JwNASQNKRVgAEwACwAGxWKRID0kAA). We can just special case this and not flow void, since it's not helpful to pin down the solution anyways. Changelog: [internal] Reviewed By: jbrown215 Differential Revision: D62779302 fbshipit-source-id: 86eb4c95ae5a13d4dff1b051eb879cd2c24e6d1d
- Loading branch information
1 parent
927449d
commit c0c9e46
Showing
3 changed files
with
66 additions
and
1 deletion.
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