-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flow says that Text and Image are not React components #18256
Comments
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest stable release? Thank you for your contributions. |
Yes, I can. I have the same results with the following setup: Packages: (wanted => installed) |
This is complicated to fix but I just finished going through it for View. Hopefully I’ll get to Text and Image by the next release cut. |
@TheSavior Thanks that would be great! Because this problem means that every file which uses Text or Image shows errors which is quite uncomfortable. |
I’m actually not sure why you are getting these errors. We don’t get these errors internally. I am planning on making modifications around this space right now but Text and Image shouldn’t be broken in the previous release... Hmm. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
We have changed the types of these components a bunch. Does this still repro on 0.56.0-rc.2? |
I'd like to try it again with a fresh project but currently I'm blocked by this problem: #19797 I'll write here again when it will be solved. |
The fix for that has landed has landed but a new version hasn’t been cut yet. You can use the fix to the flowconfig from #19766 to be able to try to repro this issue. |
Ok, #19766 led me to play around with I'm sorry about that and I would like to thank you very much for your cooperation. |
It is not possible to return JSX with an Image or a Text component from react-native which satisfies return type
Element<typeof Image>
orElement<typeof Text>
.Environment
Environment:
OS: Linux 4.13
Node: 8.10.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.0.0 => 16.1.1
react-native: ^0.52.0 => 0.52.0
Flow version: 0.66.0
Expected Behavior
Flow should say "No errors".
Actual Behavior
Flow says that it is not a React component (the same errors are shown with an Image component):
Steps to Reproduce
The simplest example:
It gives the same errors when
Text
is replaced withImage
but it works (no errors) whenText
is replaced withView
.The text was updated successfully, but these errors were encountered: