mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 12:20:38 +01:00
Follow up to #28783 and #28786. Since we've changed the implementations of these we can rename them to something a bit more descriptive while we're at it, since anyone depending on them will need to upgrade their code anyway. "react" with no condition: `__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE` "react" with "react-server" condition: `__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE` "react-dom": `__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`
26 lines
631 B
JavaScript
26 lines
631 B
JavaScript
'use strict';
|
|
|
|
var m = require('react-dom');
|
|
if (process.env.NODE_ENV === 'production') {
|
|
exports.createRoot = m.createRoot;
|
|
exports.hydrateRoot = m.hydrateRoot;
|
|
} else {
|
|
var i = m.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
exports.createRoot = function (c, o) {
|
|
i.usingClientEntryPoint = true;
|
|
try {
|
|
return m.createRoot(c, o);
|
|
} finally {
|
|
i.usingClientEntryPoint = false;
|
|
}
|
|
};
|
|
exports.hydrateRoot = function (c, h, o) {
|
|
i.usingClientEntryPoint = true;
|
|
try {
|
|
return m.hydrateRoot(c, h, o);
|
|
} finally {
|
|
i.usingClientEntryPoint = false;
|
|
}
|
|
};
|
|
}
|