: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
set: function (_currentValue2) {
context._currentValue2 = _currentValue2;
return context._threadCount;
set: function (_threadCount) {
context._threadCount = _threadCount;
if (!hasWarnedAboutUsingNestedContextConsumers) {
hasWarnedAboutUsingNestedContextConsumers = true;
error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
return context.displayName;
set: function (displayName) {
if (!hasWarnedAboutDisplayNameOnConsumer) {
warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
hasWarnedAboutDisplayNameOnConsumer = true;
}); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
context.Consumer = Consumer;
context._currentRenderer = null;
context._currentRenderer2 = null;
function lazyInitializer(payload) {
if (payload._status === Uninitialized) {
var ctor = payload._result;
var thenable = ctor(); // Transition to the next state.
// This might throw either because it's missing or throws. If so, we treat it
// as still uninitialized and try again next time. Which is the same as what
// happens if the ctor or any wrappers processing the ctor throws. This might
// end up fixing it if the resolution was a concurrency bug.
thenable.then(function (moduleObject) {
if (payload._status === Pending || payload._status === Uninitialized) {
// Transition to the next state.
resolved._status = Resolved;
resolved._result = moduleObject;
if (payload._status === Pending || payload._status === Uninitialized) {
// Transition to the next state.
rejected._status = Rejected;
rejected._result = error;
if (payload._status === Uninitialized) {
// In case, we're still uninitialized, then we're waiting for the thenable
// to resolve. Set it as pending in the meantime.
pending._status = Pending;
pending._result = thenable;
if (payload._status === Resolved) {
var moduleObject = payload._result;
if (moduleObject === undefined) {
error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
if (!('default' in moduleObject)) {
error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
return moduleObject.default;
// We use these fields to store the result.
$$typeof: REACT_LAZY_TYPE,
// In production, this would just set it on the object.
var propTypes; // $FlowFixMe
Object.defineProperties(lazyType, {
set: function (newDefaultProps) {
error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
defaultProps = newDefaultProps; // Match production behavior more closely:
Object.defineProperty(lazyType, 'defaultProps', {
set: function (newPropTypes) {
error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
propTypes = newPropTypes; // Match production behavior more closely:
Object.defineProperty(lazyType, 'propTypes', {
function forwardRef(render) {
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
} else if (typeof render !== 'function') {
error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
if (render.length !== 0 && render.length !== 2) {
error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
if (render.defaultProps != null || render.propTypes != null) {
error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
$$typeof: REACT_FORWARD_REF_TYPE,
Object.defineProperty(elementType, 'displayName', {
ownName = name; // The inner component shouldn't inherit this display name in most cases,
// because the component may be used elsewhere.
// But it's nice for anonymous functions to inherit the name,
// so that our component-stack generation logic will display their frames.
// An anonymous function generally suggests a pattern like:
// React.forwardRef((props, ref) => {...});
// This kind of inner function is not used elsewhere so the side effect is okay.
if (!render.name && !render.displayName) {
render.displayName = name;
var REACT_MODULE_REFERENCE;
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
function isValidElementType(type) {
if (typeof type === 'string' || typeof type === 'function') {
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
if (typeof type === 'object' && type !== null) {
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
function memo(type, compare) {
if (!isValidElementType(type)) {
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
$$typeof: REACT_MEMO_TYPE,
compare: compare === undefined ? null : compare
Object.defineProperty(elementType, 'displayName', {
ownName = name; // The inner component shouldn't inherit this display name in most cases,
// because the component may be used elsewhere.
// But it's nice for anonymous functions to inherit the name,
// so that our component-stack generation logic will display their frames.
// An anonymous function generally suggests a pattern like:
// React.memo((props) => {...});
// This kind of inner function is not used elsewhere so the side effect is okay.
if (!type.name && !type.displayName) {
function resolveDispatcher() {
var dispatcher = ReactCurrentDispatcher.current;
if (dispatcher === null) {
error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
} // Will result in a null access error if accessed outside render phase. We
// intentionally don't throw our own error because this is in a hot path.
// Also helps ensure this is inlined.
function useContext(Context) {
var dispatcher = resolveDispatcher();
// TODO: add a more generic warning for invalid values.
if (Context._context !== undefined) {
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
// and nobody should be using this in existing code.
if (realContext.Consumer === Context) {
error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
} else if (realContext.Provider === Context) {
error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
return dispatcher.useContext(Context);
function useState(initialState) {
var dispatcher = resolveDispatcher();
return dispatcher.useState(initialState);
function useReducer(reducer, initialArg, init) {
var dispatcher = resolveDispatcher();
return dispatcher.useReducer(reducer, initialArg, init);
function useRef(initialValue) {
var dispatcher = resolveDispatcher();
return dispatcher.useRef(initialValue);
function useEffect(create, deps) {
var dispatcher = resolveDispatcher();
return dispatcher.useEffect(create, deps);
function useInsertionEffect(create, deps) {
var dispatcher = resolveDispatcher();
return dispatcher.useInsertionEffect(create, deps);
function useLayoutEffect(create, deps) {
var dispatcher = resolveDispatcher();
return dispatcher.useLayoutEffect(create, deps);
function useCallback(callback, deps) {
var dispatcher = resolveDispatcher();
return dispatcher.useCallback(callback, deps);
function useMemo(create, deps) {
var dispatcher = resolveDispatcher();
return dispatcher.useMemo(create, deps);
function useImperativeHandle(ref, create, deps) {
var dispatcher = resolveDispatcher();
return dispatcher.useImperativeHandle(ref, create, deps);
function useDebugValue(value, formatterFn) {
var dispatcher = resolveDispatcher();
return dispatcher.useDebugValue(value, formatterFn);
function useTransition() {
var dispatcher = resolveDispatcher();
return dispatcher.useTransition();
function useDeferredValue(value) {
var dispatcher = resolveDispatcher();
return dispatcher.useDeferredValue(value);
var dispatcher = resolveDispatcher();
return dispatcher.useId();
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
var dispatcher = resolveDispatcher();
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
function disabledLog() {}
disabledLog.__reactDisabledLog = true;
if (disabledDepth === 0) {
/* eslint-disable react-internal/no-production-logging */
prevError = console.error;
prevGroup = console.group;
prevGroupCollapsed = console.groupCollapsed;
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
}; // $FlowFixMe Flow thinks console is immutable.
Object.defineProperties(console, {
/* eslint-enable react-internal/no-production-logging */
function reenableLogs() {
if (disabledDepth === 0) {
/* eslint-disable react-internal/no-production-logging */
}; // $FlowFixMe Flow thinks console is immutable.
Object.defineProperties(console, {
info: assign({}, props, {
warn: assign({}, props, {
error: assign({}, props, {
group: assign({}, props, {
groupCollapsed: assign({}, props, {
value: prevGroupCollapsed
groupEnd: assign({}, props, {
/* eslint-enable react-internal/no-production-logging */
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
function describeBuiltInComponentFrame(name, source, ownerFn) {
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
var match = x.stack.trim().match(/\n( *(at )?)/);
prefix = match && match[1] || '';
} // We use the prefix to ensure our stacks line up with native stack frames.
return '\n' + prefix + name;
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
componentFrameCache = new PossiblyWeakMap();
function describeNativeComponentFrame(fn, construct) {
// If something asked for a stack inside a fake render, it should get ignored.