Update createRoot warning message based on `enableStableConcurrentModeAPIs` (#14017)
Rauno Freiberg committed
Oct 29, 2018 at 20:25 UTC
37c7fe0a5fa5a0892b0eaa5982d0ad7f58220331
1 file changed
+3
-1
packages/react-dom/src/client/ReactDOM.js
+3
-1
@@ -772,9 +772,11 @@ type RootOptions = {
772
};
773
774
function createRoot(container: DOMContainer, options?: RootOptions): ReactRoot {
775
+ const functionName = enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot';
776
invariant(
777
isValidContainer(container),
777
- 'unstable_createRoot(...): Target container is not a DOM element.',
778
+ '%s(...): Target container is not a DOM element.',
779
+ functionName,
780
);
781
const hydrate = options != null && options.hydrate === true;
782
return new ReactRoot(container, true, hydrate);