useOptimisticState -> useOptimistic (#26772)

Drop the "state". Just "useOptimistic". It's cleaner.

This is still an experimental API. May not be the final name.

DiffTrain build for [b7972822b5](https://github.com/facebook/react/commit/b7972822b5887d05ae772ef757a453265b4b7aec)
This commit is contained in:
acdlite
2023-05-03 18:31:56 +00:00
parent 0b3882cf21
commit 098e6fd1b6
28 changed files with 406 additions and 390 deletions
+1 -1
View File
@@ -1 +1 @@
559e83aebb2026035d47aa0ebf842f78d4cd6757
b7972822b5887d05ae772ef757a453265b4b7aec
+4 -4
View File
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-www-classic-9b9fa2f6";
var ReactVersion = "18.3.0-www-classic-53439320";
// ATTENTION
// When adding new symbols to this file,
@@ -2026,10 +2026,10 @@ function useEffectEvent(callback) {
return dispatcher.useEffectEvent(callback);
}
function useOptimisticState(passthrough, reducer) {
function useOptimistic(passthrough, reducer) {
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
return dispatcher.useOptimisticState(passthrough, reducer);
return dispatcher.useOptimistic(passthrough, reducer);
}
// Helpers to patch console.logs to avoid logging during side-effect free
@@ -4180,7 +4180,7 @@ exports.createMutableSource = createMutableSource;
exports.createRef = createRef;
exports.createServerContext = createServerContext;
exports.experimental_useEffectEvent = useEffectEvent;
exports.experimental_useOptimisticState = useOptimisticState;
exports.experimental_useOptimistic = useOptimistic;
exports.forwardRef = forwardRef;
exports.isValidElement = isValidElement$1;
exports.jsx = jsx;
+4 -4
View File
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-www-modern-66e1909a";
var ReactVersion = "18.3.0-www-modern-171e8ddd";
// ATTENTION
// When adding new symbols to this file,
@@ -2026,10 +2026,10 @@ function useEffectEvent(callback) {
return dispatcher.useEffectEvent(callback);
}
function useOptimisticState(passthrough, reducer) {
function useOptimistic(passthrough, reducer) {
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
return dispatcher.useOptimisticState(passthrough, reducer);
return dispatcher.useOptimistic(passthrough, reducer);
}
// Helpers to patch console.logs to avoid logging during side-effect free
@@ -4144,7 +4144,7 @@ exports.createMutableSource = createMutableSource;
exports.createRef = createRef;
exports.createServerContext = createServerContext;
exports.experimental_useEffectEvent = useEffectEvent;
exports.experimental_useOptimisticState = useOptimisticState;
exports.experimental_useOptimistic = useOptimistic;
exports.forwardRef = forwardRef;
exports.isValidElement = isValidElement$1;
exports.jsx = jsx;
+3 -6
View File
@@ -536,11 +536,8 @@ exports.createServerContext = function (globalName, defaultValue) {
exports.experimental_useEffectEvent = function (callback) {
return ReactCurrentDispatcher.current.useEffectEvent(callback);
};
exports.experimental_useOptimisticState = function (passthrough, reducer) {
return ReactCurrentDispatcher.current.useOptimisticState(
passthrough,
reducer
);
exports.experimental_useOptimistic = function (passthrough, reducer) {
return ReactCurrentDispatcher.current.useOptimistic(passthrough, reducer);
};
exports.forwardRef = function (render) {
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
@@ -652,4 +649,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-f9e05cb4";
exports.version = "18.3.0-www-classic-f8d70dc8";
+3 -6
View File
@@ -529,11 +529,8 @@ exports.createServerContext = function (globalName, defaultValue) {
exports.experimental_useEffectEvent = function (callback) {
return ReactCurrentDispatcher.current.useEffectEvent(callback);
};
exports.experimental_useOptimisticState = function (passthrough, reducer) {
return ReactCurrentDispatcher.current.useOptimisticState(
passthrough,
reducer
);
exports.experimental_useOptimistic = function (passthrough, reducer) {
return ReactCurrentDispatcher.current.useOptimistic(passthrough, reducer);
};
exports.forwardRef = function (render) {
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
@@ -644,4 +641,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-2e6e6832";
exports.version = "18.3.0-www-modern-d4574969";
@@ -547,11 +547,8 @@ exports.createServerContext = function (globalName, defaultValue) {
exports.experimental_useEffectEvent = function (callback) {
return ReactCurrentDispatcher.current.useEffectEvent(callback);
};
exports.experimental_useOptimisticState = function (passthrough, reducer) {
return ReactCurrentDispatcher.current.useOptimisticState(
passthrough,
reducer
);
exports.experimental_useOptimistic = function (passthrough, reducer) {
return ReactCurrentDispatcher.current.useOptimistic(passthrough, reducer);
};
exports.forwardRef = function (render) {
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
@@ -663,7 +660,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-8122ba25";
exports.version = "18.3.0-www-classic-7784bb55";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -540,11 +540,8 @@ exports.createServerContext = function (globalName, defaultValue) {
exports.experimental_useEffectEvent = function (callback) {
return ReactCurrentDispatcher.current.useEffectEvent(callback);
};
exports.experimental_useOptimisticState = function (passthrough, reducer) {
return ReactCurrentDispatcher.current.useOptimisticState(
passthrough,
reducer
);
exports.experimental_useOptimistic = function (passthrough, reducer) {
return ReactCurrentDispatcher.current.useOptimistic(passthrough, reducer);
};
exports.forwardRef = function (render) {
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
@@ -655,7 +652,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-eff148b0";
exports.version = "18.3.0-www-modern-7a4b93ac";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
+47 -41
View File
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}
var ReactVersion = "18.3.0-www-classic-993a41e1";
var ReactVersion = "18.3.0-www-classic-e737edcf";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -9440,7 +9440,7 @@ function rerenderState(initialState) {
return rerenderReducer(basicStateReducer);
}
function mountOptimisticState(passthrough, reducer) {
function mountOptimistic(passthrough, reducer) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -9463,7 +9463,7 @@ function mountOptimisticState(passthrough, reducer) {
return [passthrough, dispatch];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook(); // Optimistic updates are always rebased on top of the latest value passed in
// as an argument. It's called a passthrough because if there are no pending
// updates, it will be returned as-is.
@@ -9478,8 +9478,8 @@ function updateOptimisticState(passthrough, reducer) {
return updateReducerImpl(hook, currentHook, resolvedReducer);
}
function rerenderOptimisticState(passthrough, reducer) {
// Unlike useState, useOptimisticState doesn't support render phase updates.
function rerenderOptimistic(passthrough, reducer) {
// Unlike useState, useOptimistic doesn't support render phase updates.
// Also unlike useState, we need to replay all pending updates again in case
// the passthrough value changed.
//
@@ -9488,7 +9488,7 @@ function rerenderOptimisticState(passthrough, reducer) {
// regular mount or update.
if (currentHook !== null) {
// This is an update. Process the update queue.
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
} // This is a mount. No updates to process.
var hook = updateWorkInProgressHook(); // Reset the base state and memoized state to the passthrough. Future
@@ -10456,7 +10456,7 @@ var ContextOnlyDispatcher = {
}
if (enableAsyncActions) {
ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError;
ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
}
var HooksDispatcherOnMountInDEV = null;
@@ -10626,12 +10626,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
mountHookTypesDev();
return mountOptimisticState(passthrough);
};
HooksDispatcherOnMountInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
mountHookTypesDev();
return mountOptimistic(passthrough);
};
}
HooksDispatcherOnMountWithHookTypesInDEV = {
@@ -10768,11 +10770,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountWithHookTypesInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -10910,12 +10912,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
};
HooksDispatcherOnUpdateInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return updateOptimistic(passthrough, reducer);
};
}
HooksDispatcherOnRerenderInDEV = {
@@ -11053,12 +11057,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
};
HooksDispatcherOnRerenderInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return rerenderOptimistic(passthrough, reducer);
};
}
InvalidNestedHooksDispatcherOnMountInDEV = {
@@ -11219,12 +11225,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
mountHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -11386,12 +11392,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
};
}
@@ -11553,12 +11559,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
return rerenderOptimistic(passthrough, reducer);
};
}
}
+47 -41
View File
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}
var ReactVersion = "18.3.0-www-modern-5c8e4779";
var ReactVersion = "18.3.0-www-modern-2d91b5df";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -9196,7 +9196,7 @@ function rerenderState(initialState) {
return rerenderReducer(basicStateReducer);
}
function mountOptimisticState(passthrough, reducer) {
function mountOptimistic(passthrough, reducer) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -9219,7 +9219,7 @@ function mountOptimisticState(passthrough, reducer) {
return [passthrough, dispatch];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook(); // Optimistic updates are always rebased on top of the latest value passed in
// as an argument. It's called a passthrough because if there are no pending
// updates, it will be returned as-is.
@@ -9234,8 +9234,8 @@ function updateOptimisticState(passthrough, reducer) {
return updateReducerImpl(hook, currentHook, resolvedReducer);
}
function rerenderOptimisticState(passthrough, reducer) {
// Unlike useState, useOptimisticState doesn't support render phase updates.
function rerenderOptimistic(passthrough, reducer) {
// Unlike useState, useOptimistic doesn't support render phase updates.
// Also unlike useState, we need to replay all pending updates again in case
// the passthrough value changed.
//
@@ -9244,7 +9244,7 @@ function rerenderOptimisticState(passthrough, reducer) {
// regular mount or update.
if (currentHook !== null) {
// This is an update. Process the update queue.
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
} // This is a mount. No updates to process.
var hook = updateWorkInProgressHook(); // Reset the base state and memoized state to the passthrough. Future
@@ -10212,7 +10212,7 @@ var ContextOnlyDispatcher = {
}
if (enableAsyncActions) {
ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError;
ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
}
var HooksDispatcherOnMountInDEV = null;
@@ -10382,12 +10382,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
mountHookTypesDev();
return mountOptimisticState(passthrough);
};
HooksDispatcherOnMountInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
mountHookTypesDev();
return mountOptimistic(passthrough);
};
}
HooksDispatcherOnMountWithHookTypesInDEV = {
@@ -10524,11 +10526,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountWithHookTypesInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -10666,12 +10668,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
};
HooksDispatcherOnUpdateInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return updateOptimistic(passthrough, reducer);
};
}
HooksDispatcherOnRerenderInDEV = {
@@ -10809,12 +10813,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
};
HooksDispatcherOnRerenderInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return rerenderOptimistic(passthrough, reducer);
};
}
InvalidNestedHooksDispatcherOnMountInDEV = {
@@ -10975,12 +10981,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
mountHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -11142,12 +11148,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
};
}
@@ -11309,12 +11315,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
return rerenderOptimistic(passthrough, reducer);
};
}
}
+10 -11
View File
@@ -3052,7 +3052,7 @@ function mountStateImpl(initialState) {
};
return hook;
}
function mountOptimisticState(passthrough) {
function mountOptimistic(passthrough) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -3072,7 +3072,7 @@ function mountOptimisticState(passthrough) {
queue.dispatch = hook;
return [passthrough, hook];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook();
hook.baseState = hook.memoizedState = passthrough;
return updateReducerImpl(
@@ -3081,8 +3081,8 @@ function updateOptimisticState(passthrough, reducer) {
"function" === typeof reducer ? reducer : basicStateReducer
);
}
function rerenderOptimisticState(passthrough, reducer) {
if (null !== currentHook) return updateOptimisticState(passthrough, reducer);
function rerenderOptimistic(passthrough, reducer) {
if (null !== currentHook) return updateOptimistic(passthrough, reducer);
reducer = updateWorkInProgressHook();
reducer.baseState = reducer.memoizedState = passthrough;
return [passthrough, reducer.queue.dispatch];
@@ -3410,7 +3410,7 @@ ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableAsyncActions &&
(ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError);
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
var HooksDispatcherOnMount = {
readContext: readContext,
use: use,
@@ -3555,8 +3555,7 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
return ref.impl.apply(void 0, arguments);
};
};
enableAsyncActions &&
(HooksDispatcherOnMount.useOptimisticState = mountOptimisticState);
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
var HooksDispatcherOnUpdate = {
readContext: readContext,
use: use,
@@ -3595,7 +3594,7 @@ HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnUpdate.useOptimisticState = updateOptimisticState);
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
var HooksDispatcherOnRerender = {
readContext: readContext,
use: use,
@@ -3636,7 +3635,7 @@ HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnRerender.useOptimisticState = rerenderOptimisticState);
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
function resolveDefaultProps(Component, baseProps) {
if (Component && Component.defaultProps) {
baseProps = assign({}, baseProps);
@@ -10194,7 +10193,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-classic-f56813db",
version: "18.3.0-www-classic-19d57e9b",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1325 = {
@@ -10225,7 +10224,7 @@ var internals$jscomp$inline_1325 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-f56813db"
reconcilerVersion: "18.3.0-www-classic-19d57e9b"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1326 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+10 -11
View File
@@ -2858,7 +2858,7 @@ function mountStateImpl(initialState) {
};
return hook;
}
function mountOptimisticState(passthrough) {
function mountOptimistic(passthrough) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -2878,7 +2878,7 @@ function mountOptimisticState(passthrough) {
queue.dispatch = hook;
return [passthrough, hook];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook();
hook.baseState = hook.memoizedState = passthrough;
return updateReducerImpl(
@@ -2887,8 +2887,8 @@ function updateOptimisticState(passthrough, reducer) {
"function" === typeof reducer ? reducer : basicStateReducer
);
}
function rerenderOptimisticState(passthrough, reducer) {
if (null !== currentHook) return updateOptimisticState(passthrough, reducer);
function rerenderOptimistic(passthrough, reducer) {
if (null !== currentHook) return updateOptimistic(passthrough, reducer);
reducer = updateWorkInProgressHook();
reducer.baseState = reducer.memoizedState = passthrough;
return [passthrough, reducer.queue.dispatch];
@@ -3216,7 +3216,7 @@ ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableAsyncActions &&
(ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError);
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
var HooksDispatcherOnMount = {
readContext: readContext,
use: use,
@@ -3361,8 +3361,7 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
return ref.impl.apply(void 0, arguments);
};
};
enableAsyncActions &&
(HooksDispatcherOnMount.useOptimisticState = mountOptimisticState);
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
var HooksDispatcherOnUpdate = {
readContext: readContext,
use: use,
@@ -3401,7 +3400,7 @@ HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnUpdate.useOptimisticState = updateOptimisticState);
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
var HooksDispatcherOnRerender = {
readContext: readContext,
use: use,
@@ -3442,7 +3441,7 @@ HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnRerender.useOptimisticState = rerenderOptimisticState);
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
function resolveDefaultProps(Component, baseProps) {
if (Component && Component.defaultProps) {
baseProps = assign({}, baseProps);
@@ -9859,7 +9858,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-939f40c9",
version: "18.3.0-www-modern-a1c71e8e",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1305 = {
@@ -9890,7 +9889,7 @@ var internals$jscomp$inline_1305 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-939f40c9"
reconcilerVersion: "18.3.0-www-modern-a1c71e8e"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1306 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+47 -41
View File
@@ -13989,7 +13989,7 @@ function rerenderState(initialState) {
return rerenderReducer(basicStateReducer);
}
function mountOptimisticState(passthrough, reducer) {
function mountOptimistic(passthrough, reducer) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -14012,7 +14012,7 @@ function mountOptimisticState(passthrough, reducer) {
return [passthrough, dispatch];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook(); // Optimistic updates are always rebased on top of the latest value passed in
// as an argument. It's called a passthrough because if there are no pending
// updates, it will be returned as-is.
@@ -14027,8 +14027,8 @@ function updateOptimisticState(passthrough, reducer) {
return updateReducerImpl(hook, currentHook, resolvedReducer);
}
function rerenderOptimisticState(passthrough, reducer) {
// Unlike useState, useOptimisticState doesn't support render phase updates.
function rerenderOptimistic(passthrough, reducer) {
// Unlike useState, useOptimistic doesn't support render phase updates.
// Also unlike useState, we need to replay all pending updates again in case
// the passthrough value changed.
//
@@ -14037,7 +14037,7 @@ function rerenderOptimisticState(passthrough, reducer) {
// regular mount or update.
if (currentHook !== null) {
// This is an update. Process the update queue.
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
} // This is a mount. No updates to process.
var hook = updateWorkInProgressHook(); // Reset the base state and memoized state to the passthrough. Future
@@ -15019,7 +15019,7 @@ var ContextOnlyDispatcher = {
}
if (enableAsyncActions) {
ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError;
ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
}
var HooksDispatcherOnMountInDEV = null;
@@ -15189,12 +15189,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
mountHookTypesDev();
return mountOptimisticState(passthrough);
};
HooksDispatcherOnMountInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
mountHookTypesDev();
return mountOptimistic(passthrough);
};
}
HooksDispatcherOnMountWithHookTypesInDEV = {
@@ -15331,11 +15333,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountWithHookTypesInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -15473,12 +15475,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
};
HooksDispatcherOnUpdateInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return updateOptimistic(passthrough, reducer);
};
}
HooksDispatcherOnRerenderInDEV = {
@@ -15616,12 +15620,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
};
HooksDispatcherOnRerenderInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return rerenderOptimistic(passthrough, reducer);
};
}
InvalidNestedHooksDispatcherOnMountInDEV = {
@@ -15782,12 +15788,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
mountHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -15949,12 +15955,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
};
}
@@ -16116,12 +16122,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
return rerenderOptimistic(passthrough, reducer);
};
}
}
@@ -34162,7 +34168,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-classic-8f87edd0";
var ReactVersion = "18.3.0-www-classic-741651f9";
function createPortal$1(
children,
+47 -41
View File
@@ -13930,7 +13930,7 @@ function rerenderState(initialState) {
return rerenderReducer(basicStateReducer);
}
function mountOptimisticState(passthrough, reducer) {
function mountOptimistic(passthrough, reducer) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -13953,7 +13953,7 @@ function mountOptimisticState(passthrough, reducer) {
return [passthrough, dispatch];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook(); // Optimistic updates are always rebased on top of the latest value passed in
// as an argument. It's called a passthrough because if there are no pending
// updates, it will be returned as-is.
@@ -13968,8 +13968,8 @@ function updateOptimisticState(passthrough, reducer) {
return updateReducerImpl(hook, currentHook, resolvedReducer);
}
function rerenderOptimisticState(passthrough, reducer) {
// Unlike useState, useOptimisticState doesn't support render phase updates.
function rerenderOptimistic(passthrough, reducer) {
// Unlike useState, useOptimistic doesn't support render phase updates.
// Also unlike useState, we need to replay all pending updates again in case
// the passthrough value changed.
//
@@ -13978,7 +13978,7 @@ function rerenderOptimisticState(passthrough, reducer) {
// regular mount or update.
if (currentHook !== null) {
// This is an update. Process the update queue.
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
} // This is a mount. No updates to process.
var hook = updateWorkInProgressHook(); // Reset the base state and memoized state to the passthrough. Future
@@ -14960,7 +14960,7 @@ var ContextOnlyDispatcher = {
}
if (enableAsyncActions) {
ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError;
ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
}
var HooksDispatcherOnMountInDEV = null;
@@ -15130,12 +15130,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
mountHookTypesDev();
return mountOptimisticState(passthrough);
};
HooksDispatcherOnMountInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
mountHookTypesDev();
return mountOptimistic(passthrough);
};
}
HooksDispatcherOnMountWithHookTypesInDEV = {
@@ -15272,11 +15274,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountWithHookTypesInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -15414,12 +15416,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
};
HooksDispatcherOnUpdateInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return updateOptimistic(passthrough, reducer);
};
}
HooksDispatcherOnRerenderInDEV = {
@@ -15557,12 +15561,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
};
HooksDispatcherOnRerenderInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return rerenderOptimistic(passthrough, reducer);
};
}
InvalidNestedHooksDispatcherOnMountInDEV = {
@@ -15723,12 +15729,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
mountHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -15890,12 +15896,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
};
}
@@ -16057,12 +16063,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
return rerenderOptimistic(passthrough, reducer);
};
}
}
@@ -34007,7 +34013,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-939f40c9";
var ReactVersion = "18.3.0-www-modern-a1c71e8e";
function createPortal$1(
children,
+11 -12
View File
@@ -3855,7 +3855,7 @@ function mountStateImpl(initialState) {
};
return hook;
}
function mountOptimisticState(passthrough) {
function mountOptimistic(passthrough) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -3875,7 +3875,7 @@ function mountOptimisticState(passthrough) {
queue.dispatch = hook;
return [passthrough, hook];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook();
hook.baseState = hook.memoizedState = passthrough;
return updateReducerImpl(
@@ -3884,8 +3884,8 @@ function updateOptimisticState(passthrough, reducer) {
"function" === typeof reducer ? reducer : basicStateReducer
);
}
function rerenderOptimisticState(passthrough, reducer) {
if (null !== currentHook) return updateOptimisticState(passthrough, reducer);
function rerenderOptimistic(passthrough, reducer) {
if (null !== currentHook) return updateOptimistic(passthrough, reducer);
reducer = updateWorkInProgressHook();
reducer.baseState = reducer.memoizedState = passthrough;
return [passthrough, reducer.queue.dispatch];
@@ -4213,7 +4213,7 @@ ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableAsyncActions &&
(ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError);
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
var HooksDispatcherOnMount = {
readContext: readContext,
use: use,
@@ -4388,8 +4388,7 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
return ref.impl.apply(void 0, arguments);
};
};
enableAsyncActions &&
(HooksDispatcherOnMount.useOptimisticState = mountOptimisticState);
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
var HooksDispatcherOnUpdate = {
readContext: readContext,
use: use,
@@ -4428,7 +4427,7 @@ HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnUpdate.useOptimisticState = updateOptimisticState);
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
var HooksDispatcherOnRerender = {
readContext: readContext,
use: use,
@@ -4469,7 +4468,7 @@ HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnRerender.useOptimisticState = rerenderOptimisticState);
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
function resolveDefaultProps(Component, baseProps) {
if (Component && Component.defaultProps) {
baseProps = assign({}, baseProps);
@@ -16643,7 +16642,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1829 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-97e2c99b",
version: "18.3.0-www-classic-4774adc4",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2203 = {
@@ -16673,7 +16672,7 @@ var internals$jscomp$inline_2203 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-97e2c99b"
reconcilerVersion: "18.3.0-www-classic-4774adc4"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2204 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16916,4 +16915,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-classic-97e2c99b";
exports.version = "18.3.0-www-classic-4774adc4";
+11 -12
View File
@@ -3748,7 +3748,7 @@ function mountStateImpl(initialState) {
};
return hook;
}
function mountOptimisticState(passthrough) {
function mountOptimistic(passthrough) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -3768,7 +3768,7 @@ function mountOptimisticState(passthrough) {
queue.dispatch = hook;
return [passthrough, hook];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook();
hook.baseState = hook.memoizedState = passthrough;
return updateReducerImpl(
@@ -3777,8 +3777,8 @@ function updateOptimisticState(passthrough, reducer) {
"function" === typeof reducer ? reducer : basicStateReducer
);
}
function rerenderOptimisticState(passthrough, reducer) {
if (null !== currentHook) return updateOptimisticState(passthrough, reducer);
function rerenderOptimistic(passthrough, reducer) {
if (null !== currentHook) return updateOptimistic(passthrough, reducer);
reducer = updateWorkInProgressHook();
reducer.baseState = reducer.memoizedState = passthrough;
return [passthrough, reducer.queue.dispatch];
@@ -4106,7 +4106,7 @@ ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableAsyncActions &&
(ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError);
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
var HooksDispatcherOnMount = {
readContext: readContext,
use: use,
@@ -4281,8 +4281,7 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
return ref.impl.apply(void 0, arguments);
};
};
enableAsyncActions &&
(HooksDispatcherOnMount.useOptimisticState = mountOptimisticState);
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
var HooksDispatcherOnUpdate = {
readContext: readContext,
use: use,
@@ -4321,7 +4320,7 @@ HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnUpdate.useOptimisticState = updateOptimisticState);
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
var HooksDispatcherOnRerender = {
readContext: readContext,
use: use,
@@ -4362,7 +4361,7 @@ HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnRerender.useOptimisticState = rerenderOptimisticState);
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
function resolveDefaultProps(Component, baseProps) {
if (Component && Component.defaultProps) {
baseProps = assign({}, baseProps);
@@ -16170,7 +16169,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1788 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-15711d85",
version: "18.3.0-www-modern-b136bc3a",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2167 = {
@@ -16201,7 +16200,7 @@ var internals$jscomp$inline_2167 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-15711d85"
reconcilerVersion: "18.3.0-www-modern-b136bc3a"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2168 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16372,4 +16371,4 @@ exports.unstable_createEventHandle = function (type, options) {
return eventHandle;
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-modern-15711d85";
exports.version = "18.3.0-www-modern-b136bc3a";
@@ -4001,7 +4001,7 @@ function mountStateImpl(initialState) {
};
return hook;
}
function mountOptimisticState(passthrough) {
function mountOptimistic(passthrough) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -4021,7 +4021,7 @@ function mountOptimisticState(passthrough) {
queue.dispatch = hook;
return [passthrough, hook];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook();
hook.baseState = hook.memoizedState = passthrough;
return updateReducerImpl(
@@ -4030,8 +4030,8 @@ function updateOptimisticState(passthrough, reducer) {
"function" === typeof reducer ? reducer : basicStateReducer
);
}
function rerenderOptimisticState(passthrough, reducer) {
if (null !== currentHook) return updateOptimisticState(passthrough, reducer);
function rerenderOptimistic(passthrough, reducer) {
if (null !== currentHook) return updateOptimistic(passthrough, reducer);
reducer = updateWorkInProgressHook();
reducer.baseState = reducer.memoizedState = passthrough;
return [passthrough, reducer.queue.dispatch];
@@ -4362,7 +4362,7 @@ ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableAsyncActions &&
(ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError);
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
var HooksDispatcherOnMount = {
readContext: readContext,
use: use,
@@ -4537,8 +4537,7 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
return ref.impl.apply(void 0, arguments);
};
};
enableAsyncActions &&
(HooksDispatcherOnMount.useOptimisticState = mountOptimisticState);
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
var HooksDispatcherOnUpdate = {
readContext: readContext,
use: use,
@@ -4577,7 +4576,7 @@ HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnUpdate.useOptimisticState = updateOptimisticState);
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
var HooksDispatcherOnRerender = {
readContext: readContext,
use: use,
@@ -4618,7 +4617,7 @@ HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnRerender.useOptimisticState = rerenderOptimisticState);
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
var now = Scheduler.unstable_now,
commitTime = 0,
layoutEffectStartTime = -1,
@@ -17418,7 +17417,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1914 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-5bbe5ccf",
version: "18.3.0-www-classic-b562d988",
rendererPackageName: "react-dom"
};
(function (internals) {
@@ -17462,7 +17461,7 @@ var devToolsConfig$jscomp$inline_1914 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-5bbe5ccf"
reconcilerVersion: "18.3.0-www-classic-b562d988"
});
assign(Internals, {
ReactBrowserEventEmitter: {
@@ -17692,7 +17691,7 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-classic-5bbe5ccf";
exports.version = "18.3.0-www-classic-b562d988";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -3894,7 +3894,7 @@ function mountStateImpl(initialState) {
};
return hook;
}
function mountOptimisticState(passthrough) {
function mountOptimistic(passthrough) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -3914,7 +3914,7 @@ function mountOptimisticState(passthrough) {
queue.dispatch = hook;
return [passthrough, hook];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook();
hook.baseState = hook.memoizedState = passthrough;
return updateReducerImpl(
@@ -3923,8 +3923,8 @@ function updateOptimisticState(passthrough, reducer) {
"function" === typeof reducer ? reducer : basicStateReducer
);
}
function rerenderOptimisticState(passthrough, reducer) {
if (null !== currentHook) return updateOptimisticState(passthrough, reducer);
function rerenderOptimistic(passthrough, reducer) {
if (null !== currentHook) return updateOptimistic(passthrough, reducer);
reducer = updateWorkInProgressHook();
reducer.baseState = reducer.memoizedState = passthrough;
return [passthrough, reducer.queue.dispatch];
@@ -4255,7 +4255,7 @@ ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableAsyncActions &&
(ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError);
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
var HooksDispatcherOnMount = {
readContext: readContext,
use: use,
@@ -4430,8 +4430,7 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
return ref.impl.apply(void 0, arguments);
};
};
enableAsyncActions &&
(HooksDispatcherOnMount.useOptimisticState = mountOptimisticState);
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
var HooksDispatcherOnUpdate = {
readContext: readContext,
use: use,
@@ -4470,7 +4469,7 @@ HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnUpdate.useOptimisticState = updateOptimisticState);
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
var HooksDispatcherOnRerender = {
readContext: readContext,
use: use,
@@ -4511,7 +4510,7 @@ HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnRerender.useOptimisticState = rerenderOptimisticState);
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
var now = Scheduler.unstable_now,
commitTime = 0,
layoutEffectStartTime = -1,
@@ -16939,7 +16938,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1873 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-55add5ba",
version: "18.3.0-www-modern-e58fb3cf",
rendererPackageName: "react-dom"
};
(function (internals) {
@@ -16984,7 +16983,7 @@ var devToolsConfig$jscomp$inline_1873 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-55add5ba"
reconcilerVersion: "18.3.0-www-modern-e58fb3cf"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = function (children, container) {
@@ -17142,7 +17141,7 @@ exports.unstable_createEventHandle = function (type, options) {
return eventHandle;
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-modern-55add5ba";
exports.version = "18.3.0-www-modern-e58fb3cf";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");
var ReactVersion = "18.3.0-www-classic-ccb1f72b";
var ReactVersion = "18.3.0-www-classic-7f904b45";
// This refers to a WWW module.
var warningWWW = require("warning");
@@ -10114,7 +10114,7 @@ function unsupportedSetOptimisticState() {
throw new Error("Cannot update optimistic state while rendering.");
}
function useOptimisticState(passthrough, reducer) {
function useOptimistic(passthrough, reducer) {
resolveCurrentlyRenderingComponent();
return [passthrough, unsupportedSetOptimisticState];
}
@@ -10222,7 +10222,7 @@ var HooksDispatcher = {
}
if (enableAsyncActions) {
HooksDispatcher.useOptimisticState = useOptimisticState;
HooksDispatcher.useOptimistic = useOptimistic;
}
var currentResponseState = null;
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");
var ReactVersion = "18.3.0-www-modern-88959423";
var ReactVersion = "18.3.0-www-modern-45591960";
// This refers to a WWW module.
var warningWWW = require("warning");
@@ -9873,7 +9873,7 @@ function unsupportedSetOptimisticState() {
throw new Error("Cannot update optimistic state while rendering.");
}
function useOptimisticState(passthrough, reducer) {
function useOptimistic(passthrough, reducer) {
resolveCurrentlyRenderingComponent();
return [passthrough, unsupportedSetOptimisticState];
}
@@ -9981,7 +9981,7 @@ var HooksDispatcher = {
}
if (enableAsyncActions) {
HooksDispatcher.useOptimisticState = useOptimisticState;
HooksDispatcher.useOptimistic = useOptimistic;
}
var currentResponseState = null;
@@ -2564,7 +2564,7 @@ function unsupportedStartTransition() {
function unsupportedSetOptimisticState() {
throw Error(formatProdErrorMessage(479));
}
function useOptimisticState(passthrough) {
function useOptimistic(passthrough) {
resolveCurrentlyRenderingComponent();
return [passthrough, unsupportedSetOptimisticState];
}
@@ -2666,7 +2666,7 @@ var HooksDispatcher = {
return data;
}
};
enableAsyncActions && (HooksDispatcher.useOptimisticState = useOptimisticState);
enableAsyncActions && (HooksDispatcher.useOptimistic = useOptimistic);
var currentResponseState = null,
DefaultCacheDispatcher = {
getCacheSignal: function () {
@@ -4002,4 +4002,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "18.3.0-www-classic-3fbcb92a";
exports.version = "18.3.0-www-classic-f0c37f65";
@@ -2498,7 +2498,7 @@ function unsupportedStartTransition() {
function unsupportedSetOptimisticState() {
throw Error(formatProdErrorMessage(479));
}
function useOptimisticState(passthrough) {
function useOptimistic(passthrough) {
resolveCurrentlyRenderingComponent();
return [passthrough, unsupportedSetOptimisticState];
}
@@ -2600,7 +2600,7 @@ var HooksDispatcher = {
return data;
}
};
enableAsyncActions && (HooksDispatcher.useOptimisticState = useOptimisticState);
enableAsyncActions && (HooksDispatcher.useOptimistic = useOptimistic);
var currentResponseState = null,
DefaultCacheDispatcher = {
getCacheSignal: function () {
@@ -3900,4 +3900,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "18.3.0-www-modern-6ee2853c";
exports.version = "18.3.0-www-modern-5e9b2f5f";
@@ -9765,7 +9765,7 @@ function unsupportedSetOptimisticState() {
throw new Error("Cannot update optimistic state while rendering.");
}
function useOptimisticState(passthrough, reducer) {
function useOptimistic(passthrough, reducer) {
resolveCurrentlyRenderingComponent();
return [passthrough, unsupportedSetOptimisticState];
}
@@ -9873,7 +9873,7 @@ var HooksDispatcher = {
}
if (enableAsyncActions) {
HooksDispatcher.useOptimisticState = useOptimisticState;
HooksDispatcher.useOptimistic = useOptimistic;
}
var currentResponseState = null;
@@ -2518,7 +2518,7 @@ function unsupportedStartTransition() {
function unsupportedSetOptimisticState() {
throw Error("Cannot update optimistic state while rendering.");
}
function useOptimisticState(passthrough) {
function useOptimistic(passthrough) {
resolveCurrentlyRenderingComponent();
return [passthrough, unsupportedSetOptimisticState];
}
@@ -2626,7 +2626,7 @@ var HooksDispatcher = {
return data;
}
};
enableAsyncActions && (HooksDispatcher.useOptimisticState = useOptimisticState);
enableAsyncActions && (HooksDispatcher.useOptimistic = useOptimistic);
var currentResponseState = null,
DefaultCacheDispatcher = {
getCacheSignal: function () {
@@ -14123,7 +14123,7 @@ function rerenderState(initialState) {
return rerenderReducer(basicStateReducer);
}
function mountOptimisticState(passthrough, reducer) {
function mountOptimistic(passthrough, reducer) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -14146,7 +14146,7 @@ function mountOptimisticState(passthrough, reducer) {
return [passthrough, dispatch];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook(); // Optimistic updates are always rebased on top of the latest value passed in
// as an argument. It's called a passthrough because if there are no pending
// updates, it will be returned as-is.
@@ -14161,8 +14161,8 @@ function updateOptimisticState(passthrough, reducer) {
return updateReducerImpl(hook, currentHook, resolvedReducer);
}
function rerenderOptimisticState(passthrough, reducer) {
// Unlike useState, useOptimisticState doesn't support render phase updates.
function rerenderOptimistic(passthrough, reducer) {
// Unlike useState, useOptimistic doesn't support render phase updates.
// Also unlike useState, we need to replay all pending updates again in case
// the passthrough value changed.
//
@@ -14171,7 +14171,7 @@ function rerenderOptimisticState(passthrough, reducer) {
// regular mount or update.
if (currentHook !== null) {
// This is an update. Process the update queue.
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
} // This is a mount. No updates to process.
var hook = updateWorkInProgressHook(); // Reset the base state and memoized state to the passthrough. Future
@@ -15153,7 +15153,7 @@ var ContextOnlyDispatcher = {
}
if (enableAsyncActions) {
ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError;
ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
}
var HooksDispatcherOnMountInDEV = null;
@@ -15323,12 +15323,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
mountHookTypesDev();
return mountOptimisticState(passthrough);
};
HooksDispatcherOnMountInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
mountHookTypesDev();
return mountOptimistic(passthrough);
};
}
HooksDispatcherOnMountWithHookTypesInDEV = {
@@ -15465,11 +15467,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountWithHookTypesInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -15607,12 +15609,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
};
HooksDispatcherOnUpdateInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return updateOptimistic(passthrough, reducer);
};
}
HooksDispatcherOnRerenderInDEV = {
@@ -15750,12 +15754,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
};
HooksDispatcherOnRerenderInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return rerenderOptimistic(passthrough, reducer);
};
}
InvalidNestedHooksDispatcherOnMountInDEV = {
@@ -15916,12 +15922,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
mountHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -16083,12 +16089,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
};
}
@@ -16250,12 +16256,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
return rerenderOptimistic(passthrough, reducer);
};
}
}
@@ -34779,7 +34785,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-classic-c84cd989";
var ReactVersion = "18.3.0-www-classic-aba03bce";
function createPortal$1(
children,
@@ -14064,7 +14064,7 @@ function rerenderState(initialState) {
return rerenderReducer(basicStateReducer);
}
function mountOptimisticState(passthrough, reducer) {
function mountOptimistic(passthrough, reducer) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -14087,7 +14087,7 @@ function mountOptimisticState(passthrough, reducer) {
return [passthrough, dispatch];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook(); // Optimistic updates are always rebased on top of the latest value passed in
// as an argument. It's called a passthrough because if there are no pending
// updates, it will be returned as-is.
@@ -14102,8 +14102,8 @@ function updateOptimisticState(passthrough, reducer) {
return updateReducerImpl(hook, currentHook, resolvedReducer);
}
function rerenderOptimisticState(passthrough, reducer) {
// Unlike useState, useOptimisticState doesn't support render phase updates.
function rerenderOptimistic(passthrough, reducer) {
// Unlike useState, useOptimistic doesn't support render phase updates.
// Also unlike useState, we need to replay all pending updates again in case
// the passthrough value changed.
//
@@ -14112,7 +14112,7 @@ function rerenderOptimisticState(passthrough, reducer) {
// regular mount or update.
if (currentHook !== null) {
// This is an update. Process the update queue.
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
} // This is a mount. No updates to process.
var hook = updateWorkInProgressHook(); // Reset the base state and memoized state to the passthrough. Future
@@ -15094,7 +15094,7 @@ var ContextOnlyDispatcher = {
}
if (enableAsyncActions) {
ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError;
ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
}
var HooksDispatcherOnMountInDEV = null;
@@ -15264,12 +15264,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
mountHookTypesDev();
return mountOptimisticState(passthrough);
};
HooksDispatcherOnMountInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
mountHookTypesDev();
return mountOptimistic(passthrough);
};
}
HooksDispatcherOnMountWithHookTypesInDEV = {
@@ -15406,11 +15408,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnMountWithHookTypesInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -15548,12 +15550,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
};
HooksDispatcherOnUpdateInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return updateOptimistic(passthrough, reducer);
};
}
HooksDispatcherOnRerenderInDEV = {
@@ -15691,12 +15695,14 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
HooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
};
HooksDispatcherOnRerenderInDEV.useOptimistic = function useOptimistic(
passthrough,
reducer
) {
currentHookNameInDev = "useOptimistic";
updateHookTypesDev();
return rerenderOptimistic(passthrough, reducer);
};
}
InvalidNestedHooksDispatcherOnMountInDEV = {
@@ -15857,12 +15863,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnMountInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
mountHookTypesDev();
return mountOptimisticState(passthrough);
return mountOptimistic(passthrough);
};
}
@@ -16024,12 +16030,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return updateOptimisticState(passthrough, reducer);
return updateOptimistic(passthrough, reducer);
};
}
@@ -16191,12 +16197,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}
if (enableAsyncActions) {
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimisticState =
function useOptimisticState(passthrough, reducer) {
currentHookNameInDev = "useOptimisticState";
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic =
function useOptimistic(passthrough, reducer) {
currentHookNameInDev = "useOptimistic";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderOptimisticState(passthrough, reducer);
return rerenderOptimistic(passthrough, reducer);
};
}
}
@@ -34624,7 +34630,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-8a31c6c4";
var ReactVersion = "18.3.0-www-modern-647efb04";
function createPortal$1(
children,
@@ -3941,7 +3941,7 @@ function mountStateImpl(initialState) {
};
return hook;
}
function mountOptimisticState(passthrough) {
function mountOptimistic(passthrough) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -3961,7 +3961,7 @@ function mountOptimisticState(passthrough) {
queue.dispatch = hook;
return [passthrough, hook];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook();
hook.baseState = hook.memoizedState = passthrough;
return updateReducerImpl(
@@ -3970,8 +3970,8 @@ function updateOptimisticState(passthrough, reducer) {
"function" === typeof reducer ? reducer : basicStateReducer
);
}
function rerenderOptimisticState(passthrough, reducer) {
if (null !== currentHook) return updateOptimisticState(passthrough, reducer);
function rerenderOptimistic(passthrough, reducer) {
if (null !== currentHook) return updateOptimistic(passthrough, reducer);
reducer = updateWorkInProgressHook();
reducer.baseState = reducer.memoizedState = passthrough;
return [passthrough, reducer.queue.dispatch];
@@ -4299,7 +4299,7 @@ ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableAsyncActions &&
(ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError);
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
var HooksDispatcherOnMount = {
readContext: readContext,
use: use,
@@ -4474,8 +4474,7 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
return ref.impl.apply(void 0, arguments);
};
};
enableAsyncActions &&
(HooksDispatcherOnMount.useOptimisticState = mountOptimisticState);
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
var HooksDispatcherOnUpdate = {
readContext: readContext,
use: use,
@@ -4514,7 +4513,7 @@ HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnUpdate.useOptimisticState = updateOptimisticState);
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
var HooksDispatcherOnRerender = {
readContext: readContext,
use: use,
@@ -4555,7 +4554,7 @@ HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnRerender.useOptimisticState = rerenderOptimisticState);
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
function resolveDefaultProps(Component, baseProps) {
if (Component && Component.defaultProps) {
baseProps = assign({}, baseProps);
@@ -16972,7 +16971,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1858 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-993a41e1",
version: "18.3.0-www-classic-e737edcf",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2237 = {
@@ -17002,7 +17001,7 @@ var internals$jscomp$inline_2237 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-993a41e1"
reconcilerVersion: "18.3.0-www-classic-e737edcf"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2238 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17396,4 +17395,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-classic-993a41e1";
exports.version = "18.3.0-www-classic-e737edcf";
@@ -3889,7 +3889,7 @@ function mountStateImpl(initialState) {
};
return hook;
}
function mountOptimisticState(passthrough) {
function mountOptimistic(passthrough) {
var hook = mountWorkInProgressHook();
hook.memoizedState = hook.baseState = passthrough;
var queue = {
@@ -3909,7 +3909,7 @@ function mountOptimisticState(passthrough) {
queue.dispatch = hook;
return [passthrough, hook];
}
function updateOptimisticState(passthrough, reducer) {
function updateOptimistic(passthrough, reducer) {
var hook = updateWorkInProgressHook();
hook.baseState = hook.memoizedState = passthrough;
return updateReducerImpl(
@@ -3918,8 +3918,8 @@ function updateOptimisticState(passthrough, reducer) {
"function" === typeof reducer ? reducer : basicStateReducer
);
}
function rerenderOptimisticState(passthrough, reducer) {
if (null !== currentHook) return updateOptimisticState(passthrough, reducer);
function rerenderOptimistic(passthrough, reducer) {
if (null !== currentHook) return updateOptimistic(passthrough, reducer);
reducer = updateWorkInProgressHook();
reducer.baseState = reducer.memoizedState = passthrough;
return [passthrough, reducer.queue.dispatch];
@@ -4247,7 +4247,7 @@ ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableAsyncActions &&
(ContextOnlyDispatcher.useOptimisticState = throwInvalidHookError);
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
var HooksDispatcherOnMount = {
readContext: readContext,
use: use,
@@ -4422,8 +4422,7 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
return ref.impl.apply(void 0, arguments);
};
};
enableAsyncActions &&
(HooksDispatcherOnMount.useOptimisticState = mountOptimisticState);
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
var HooksDispatcherOnUpdate = {
readContext: readContext,
use: use,
@@ -4462,7 +4461,7 @@ HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnUpdate.useOptimisticState = updateOptimisticState);
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
var HooksDispatcherOnRerender = {
readContext: readContext,
use: use,
@@ -4503,7 +4502,7 @@ HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
enableAsyncActions &&
(HooksDispatcherOnRerender.useOptimisticState = rerenderOptimisticState);
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
function resolveDefaultProps(Component, baseProps) {
if (Component && Component.defaultProps) {
baseProps = assign({}, baseProps);
@@ -16554,7 +16553,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1817 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-66e1909a",
version: "18.3.0-www-modern-171e8ddd",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2201 = {
@@ -16585,7 +16584,7 @@ var internals$jscomp$inline_2201 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-66e1909a"
reconcilerVersion: "18.3.0-www-modern-171e8ddd"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2202 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16907,4 +16906,4 @@ exports.unstable_createEventHandle = function (type, options) {
return eventHandle;
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-modern-66e1909a";
exports.version = "18.3.0-www-modern-171e8ddd";
@@ -24549,7 +24549,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-66e1909a";
var ReactVersion = "18.3.0-www-modern-171e8ddd";
// Might add PROFILE later.