mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Let ReactDOM initialize in RSC (#25503)
With the `react-dom/server-rendering-stub` you can import `react-dom` in RSC so that you can call `preload` and `preinit` but if you don't alias it, then requiring it breaks because we React.Component which doesn't exist in the react subset.
This commit is contained in:
committed by
Rick Hanlon
parent
84ebdc2554
commit
4b0fb76bbd
@@ -50,6 +50,14 @@ jest.mock('react', () => {
|
||||
return jest.requireActual(resolvedEntryPoint);
|
||||
});
|
||||
|
||||
jest.mock('react/react.shared-subset', () => {
|
||||
const resolvedEntryPoint = resolveEntryFork(
|
||||
require.resolve('react/src/ReactSharedSubset'),
|
||||
global.__WWW__
|
||||
);
|
||||
return jest.requireActual(resolvedEntryPoint);
|
||||
});
|
||||
|
||||
jest.mock('react-reconciler/src/ReactFiberReconciler', () => {
|
||||
return jest.requireActual(
|
||||
__VARIANT__
|
||||
|
||||
Reference in New Issue
Block a user