mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Update createRoot warning message based on enableStableConcurrentModeAPIs (#14017)
This commit is contained in:
1 parent
ae4f3f07e5
commit
37c7fe0a5f
1 file changed
+3
-1
+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