-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
Call and Return components should use ReactElement #11834
Merged
acdlite
merged 5 commits into
facebook:master
from
acdlite:use-elements-for-call-and-return
Dec 12, 2017
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7aa0d19
Call and Return components should use ReactElement
acdlite 04d2358
Move server render invariant for call and return types
acdlite ff70350
Sort ReactElement type checks by most likely
acdlite 15ab1fc
Performance timeline should skip over call components
acdlite c4a89ae
Remove surrounding brackets from internal display names
acdlite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -621,11 +621,6 @@ class ReactDOMServerRenderer { | |
'Portals are not currently supported by the server renderer. ' + | ||
'Render them conditionally so that they only appear on the client render.', | ||
); | ||
invariant( | ||
$$typeof !== REACT_CALL_TYPE && $$typeof !== REACT_RETURN_TYPE, | ||
'The experimental Call and Return types are not currently ' + | ||
'supported by the server renderer.', | ||
); | ||
// Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type. | ||
invariant( | ||
false, | ||
|
@@ -678,6 +673,12 @@ class ReactDOMServerRenderer { | |
context: Object, | ||
parentNamespace: string, | ||
): string { | ||
invariant( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...but this is. Seems unfortunate to run this check every time. (Also, if we do this I’d expect it to happen outside of Since we already read |
||
element.type !== REACT_CALL_TYPE && element.type !== REACT_RETURN_TYPE, | ||
'The experimental Call and Return types are not currently ' + | ||
'supported by the server renderer.', | ||
); | ||
|
||
const tag = element.type.toLowerCase(); | ||
|
||
let namespace = parentNamespace; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This wasn’t a hot path...
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.
Updated
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.
Thanks, that part looks good