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
Instead of createElement.
We should have done this when we initially released jsx-runtime but
better late than never. The general principle is that our tests should
be written using the most up-to-date idioms that we recommend for users,
except when explicitly testing an edge case or legacy behavior, like for
backwards compatibility.
Most of the diff is related to tweaking test output and isn't very
interesting.
I did have to workaround an issue related to component stacks. The
component stack logic depends on shared state that lives in the React
module. The problem is that most of our tests reset the React module
state and re-require a fresh instance of React, React DOM, etc. However,
the JSX runtime is not re-required because it's injected by the compiler
as a static import. This means its copy of the shared state is no longer
the same as the one used by React, causing any warning logged by the JSX
runtime to not include a component stack. (This same issue also breaks
string refs, but since we're removing those soon I'm not so concerned
about that.) The solution I went with for now is to mock the JSX runtime
with a proxy that re-requires the module on every function invocation. I
don't love this but it will have to do for now. What we should really do
is migrate our tests away from manually resetting the module state and
use import syntax instead.
DiffTrain build for commit 952aa74.
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
@@ -25600,7 +25600,7 @@ if (__DEV__) {
25600
25600
return root;
25601
25601
}
25602
25602
25603
-
var ReactVersion = "18.3.0-canary-2bc7d336a-20240205";
25603
+
var ReactVersion = "18.3.0-canary-952aa74f8-20240205";
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
@@ -9150,7 +9150,7 @@ var devToolsConfig$jscomp$inline_1012 = {
9150
9150
throwError("TestRenderer does not support findFiberByHostInstance()");
9151
9151
},
9152
9152
bundleType: 0,
9153
-
version: "18.3.0-canary-2bc7d336a-20240205",
9153
+
version: "18.3.0-canary-952aa74f8-20240205",
9154
9154
rendererPackageName: "react-test-renderer"
9155
9155
};
9156
9156
varinternals$jscomp$inline_1190={
@@ -9181,7 +9181,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
@@ -9578,7 +9578,7 @@ var devToolsConfig$jscomp$inline_1054 = {
9578
9578
throwError("TestRenderer does not support findFiberByHostInstance()");
9579
9579
},
9580
9580
bundleType: 0,
9581
-
version: "18.3.0-canary-2bc7d336a-20240205",
9581
+
version: "18.3.0-canary-952aa74f8-20240205",
9582
9582
rendererPackageName: "react-test-renderer"
9583
9583
};
9584
9584
varinternals$jscomp$inline_1231={
@@ -9609,7 +9609,7 @@ var internals$jscomp$inline_1231 = {
0 commit comments