mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Update createRoot warning message based on enableStableConcurrentModeAPIs (#14017)
This commit is contained in:
committed by
Andrew Clark
parent
ae4f3f07e5
commit
37c7fe0a5f
+3
-1
@@ -772,9 +772,11 @@ type RootOptions = {
|
||||
};
|
||||
|
||||
function createRoot(container: DOMContainer, options?: RootOptions): ReactRoot {
|
||||
const functionName = enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot';
|
||||
invariant(
|
||||
isValidContainer(container),
|
||||
'unstable_createRoot(...): Target container is not a DOM element.',
|
||||
'%s(...): Target container is not a DOM element.',
|
||||
functionName,
|
||||
);
|
||||
const hydrate = options != null && options.hydrate === true;
|
||||
return new ReactRoot(container, true, hydrate);
|
||||
|
||||
Reference in New Issue
Block a user