-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Enable module pattern. #6008
Enable module pattern. #6008
Conversation
It was working before, wasn’t it? Did something in the recent PRs cause it to break? |
(Masterwork From Distant Lands is the default title for a paste in Phabricator.) |
@gaearon Yes, I accidentally broke it when enabling null from stateless components |
inst === null || | ||
inst === false || | ||
ReactElement.isValidElement(inst), | ||
'%s(...): Stateless function components must return a valid ReactElement.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have more consistent wording here and in _renderValidatedComponent? (Looks like that one's currently wrong because it says component instead of element.) Maybe:
A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
I think this is good. cc @sebmarkbage to verify we want to duck type the return value about whether it has a |
@jimfb updated the pull request. |
fa032e5
to
428ef03
Compare
@jimfb updated the pull request. |
We have an invariant that checks the same case right afterwards. The warning was originally added in facebook#5884 with a distinct wording. However it was later changed to the same wording as the invariant in facebook#6008. I don't see why we would want to have both since they're saying the same thing and with (almost) the same internal stack.
We have an invariant that checks the same case right afterwards. The warning was originally added in facebook#5884 with a distinct wording. However it was later changed to the same wording as the invariant in facebook#6008. I don't see why we would want to have both since they're saying the same thing and with (almost) the same internal stack.
@spicyj Your Masterwork From Distant Lands, plus a couple minor bug fixes.