Flatten ReactSharedInternals (#28783)

This is similar to #28771 but for isomorphic. We need a make over for
these dispatchers anyway so this is the first step. Also helps flush out
some internals usage that will break anyway.

It flattens the inner mutable objects onto the ReactSharedInternals.
This commit is contained in:
Sebastian Markbåge
2024-04-08 19:23:23 -04:00
committed by GitHub
parent acef2f8111
commit d50323eb84
65 changed files with 652 additions and 791 deletions
@@ -86,8 +86,8 @@ export function describeNativeComponentFrame(
// Note that unlike the code this was forked from (in ReactComponentStackFrame)
// DevTools should override the dispatcher even when DevTools is compiled in production mode,
// because the app itself may be in development mode and log errors/warnings.
const previousDispatcher = currentDispatcherRef.current;
currentDispatcherRef.current = null;
const previousDispatcher = currentDispatcherRef.H;
currentDispatcherRef.H = null;
disableLogs();
// NOTE: keep in sync with the implementation in ReactComponentStackFrame
@@ -270,7 +270,7 @@ export function describeNativeComponentFrame(
Error.prepareStackTrace = previousPrepareStackTrace;
currentDispatcherRef.current = previousDispatcher;
currentDispatcherRef.H = previousDispatcher;
reenableLogs();
}
// Fallback to just using the name if we couldn't make it throw.