Update createRoot warning message based on enableStableConcurrentModeAPIs (#14017)

This commit is contained in:
Rauno Freiberg
2018-10-29 11:25:24 -07:00
committed by Andrew Clark
parent ae4f3f07e5
commit 37c7fe0a5f
+3 -1
View File
@@ -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);