-
Notifications
You must be signed in to change notification settings - Fork 46.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flight] Unify plain Server Component and forwardRef under one functi…
…on (#28261) This used to be trivial but it's no longer trivial. In Fizz and Fiber this is split into renderWithHooks and finishFunctionComponent since they also support indeterminate components. Interestingly thanks to this unification we always call functions with an arity of 2 which is a bit weird - with the second argument being undefined in everything except forwardRef and legacy context consumers. This makes Flight makes the same thing but we could also call it with an arity of 1. Since Flight errors early if you try to pass it a ref, and there's no legacy context, the second arg is always undefined. The practical change in this PR is that returning a Promise from a forwardRef now turns it into a lazy. We previously didn't support async forwardRef since it wasn't supported on the client. However, since eventually this will be supported by child-as-a-promise it seems fine to support it. DiffTrain build for [f07ac1e](f07ac1e)
- Loading branch information
1 parent
de5b760
commit 7a01513
Showing
5 changed files
with
98 additions
and
137 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1beb94133a93a433669a893aef02dd5afec07394 | ||
f07ac1e2680a26c5b3bf9c651d62c792de71d46d |
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