You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Flight] Unify plain Server Component and forwardRef under one function (#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 commit f07ac1e.
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25725,7 +25725,7 @@ if (__DEV__) {
25725
25725
return root;
25726
25726
}
25727
25727
25728
-
var ReactVersion = "18.3.0-canary-1beb94133-20240206";
25728
+
var ReactVersion = "18.3.0-canary-f07ac1e26-20240206";
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9157,7 +9157,7 @@ var devToolsConfig$jscomp$inline_1012 = {
9157
9157
throwError("TestRenderer does not support findFiberByHostInstance()");
9158
9158
},
9159
9159
bundleType: 0,
9160
-
version: "18.3.0-canary-1beb94133-20240206",
9160
+
version: "18.3.0-canary-f07ac1e26-20240206",
9161
9161
rendererPackageName: "react-test-renderer"
9162
9162
};
9163
9163
varinternals$jscomp$inline_1190={
@@ -9188,7 +9188,7 @@ var internals$jscomp$inline_1190 = {
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9585,7 +9585,7 @@ var devToolsConfig$jscomp$inline_1054 = {
9585
9585
throwError("TestRenderer does not support findFiberByHostInstance()");
9586
9586
},
9587
9587
bundleType: 0,
9588
-
version: "18.3.0-canary-1beb94133-20240206",
9588
+
version: "18.3.0-canary-f07ac1e26-20240206",
9589
9589
rendererPackageName: "react-test-renderer"
9590
9590
};
9591
9591
varinternals$jscomp$inline_1231={
@@ -9616,7 +9616,7 @@ var internals$jscomp$inline_1231 = {
0 commit comments