mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
useFormState: Reuse state from previous form submission (#27321)
If a Server Action is passed to useFormState, the action may be
submitted before it has hydrated. This will trigger a full page
(MPA-style) navigation. We can transfer the form state to the next page
by comparing the key path of the hook instance.
`ReactServerDOMServer.decodeFormState` is used by the server to extract
the form state from the submitted action. This value can then be passed
as an option when rendering the new page. It must be passed during both
SSR and hydration.
```js
const boundAction = await decodeAction(formData, serverManifest);
const result = await boundAction();
const formState = decodeFormState(result, formData, serverManifest);
// SSR
const response = createFromReadableStream(<App />);
const ssrStream = await renderToReadableStream(response, { formState })
// Hydration
hydrateRoot(container, <App />, { formState });
```
If the `formState` option is omitted, then the state won't be
transferred to the next page. However, it must be passed in both places,
or in neither; misconfiguring will result in a hydration mismatch.
(The `formState` option is currently prefixed with `experimental_`)
DiffTrain build for commit https://github.com/facebook/react/commit/612b2b6601abb844248c384d1e288bb824b180b7.
This commit is contained in:
+14
-7
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<cd445f3b30b95bc14ba23cb28c191840>>
|
||||
* @generated SignedSource<<90d4b49133c0f3de327f45d0812fd8e9>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -23883,7 +23883,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -23917,6 +23918,7 @@ function FiberRootNode(
|
||||
this.pooledCacheLanes = NoLanes;
|
||||
}
|
||||
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
|
||||
{
|
||||
@@ -23950,7 +23952,8 @@ function createFiberRoot(
|
||||
// single type, like a DynamicHostConfig that is defined by the renderer.
|
||||
identifierPrefix,
|
||||
onRecoverableError,
|
||||
transitionCallbacks
|
||||
transitionCallbacks,
|
||||
formState
|
||||
) {
|
||||
// $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
|
||||
var root = new FiberRootNode(
|
||||
@@ -23958,7 +23961,8 @@ function createFiberRoot(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
);
|
||||
// stateNode is any.
|
||||
|
||||
@@ -23994,7 +23998,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-canary-e5205658f-20230913";
|
||||
var ReactVersion = "18.3.0-canary-612b2b660-20230913";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
@@ -24044,7 +24048,9 @@ function createContainer(
|
||||
isStrictMode,
|
||||
concurrentUpdatesByDefaultOverride,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
transitionCallbacks,
|
||||
null
|
||||
);
|
||||
}
|
||||
function updateContainer(element, container, parentComponent, callback) {
|
||||
@@ -24911,7 +24917,8 @@ function create(element, options) {
|
||||
isStrictMode,
|
||||
concurrentUpdatesByDefault,
|
||||
"",
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
);
|
||||
|
||||
if (root == null) {
|
||||
|
||||
+23
-19
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<d1b32810e51fc98372bfbb5c93420bef>>
|
||||
* @generated SignedSource<<5361a5f040398d7d166b0f13b30a010c>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -8179,7 +8179,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -8212,6 +8213,7 @@ function FiberRootNode(
|
||||
this.onRecoverableError = onRecoverableError;
|
||||
this.pooledCache = null;
|
||||
this.pooledCacheLanes = 0;
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
}
|
||||
function createContainer(
|
||||
@@ -8228,7 +8230,8 @@ function createContainer(
|
||||
tag,
|
||||
!1,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
);
|
||||
1 === tag
|
||||
? ((tag = 1),
|
||||
@@ -8612,19 +8615,19 @@ function wrapFiber(fiber) {
|
||||
fiberToWrapper.set(fiber, wrapper));
|
||||
return wrapper;
|
||||
}
|
||||
var devToolsConfig$jscomp$inline_1027 = {
|
||||
var devToolsConfig$jscomp$inline_1028 = {
|
||||
findFiberByHostInstance: function () {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-e5205658f-20230913",
|
||||
version: "18.3.0-canary-612b2b660-20230913",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1226 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1027.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1027.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1027.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1027.rendererConfig,
|
||||
var internals$jscomp$inline_1227 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1028.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1028.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1028.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1028.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -8641,26 +8644,26 @@ var internals$jscomp$inline_1226 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1027.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1028.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-e5205658f-20230913"
|
||||
reconcilerVersion: "18.3.0-canary-612b2b660-20230913"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1227 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1228 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1227.isDisabled &&
|
||||
hook$jscomp$inline_1227.supportsFiber
|
||||
!hook$jscomp$inline_1228.isDisabled &&
|
||||
hook$jscomp$inline_1228.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1227.inject(
|
||||
internals$jscomp$inline_1226
|
||||
(rendererID = hook$jscomp$inline_1228.inject(
|
||||
internals$jscomp$inline_1227
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1227);
|
||||
(injectedHook = hook$jscomp$inline_1228);
|
||||
} catch (err) {}
|
||||
}
|
||||
exports._Scheduler = Scheduler;
|
||||
@@ -8691,7 +8694,8 @@ exports.create = function (element, options) {
|
||||
isStrictMode,
|
||||
concurrentUpdatesByDefault,
|
||||
"",
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
);
|
||||
if (null == root) throw Error("something went wrong");
|
||||
updateContainer(element, root, null, null);
|
||||
|
||||
+23
-19
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<c0a54e40c38caf663b646a4c7f7321d1>>
|
||||
* @generated SignedSource<<486546c05387fd5f0f9d0c9c12aa9b75>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -8603,7 +8603,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -8636,6 +8637,7 @@ function FiberRootNode(
|
||||
this.onRecoverableError = onRecoverableError;
|
||||
this.pooledCache = null;
|
||||
this.pooledCacheLanes = 0;
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
this.passiveEffectDuration = this.effectDuration = 0;
|
||||
}
|
||||
@@ -8653,7 +8655,8 @@ function createContainer(
|
||||
tag,
|
||||
!1,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
);
|
||||
1 === tag
|
||||
? ((tag = 1),
|
||||
@@ -9038,19 +9041,19 @@ function wrapFiber(fiber) {
|
||||
fiberToWrapper.set(fiber, wrapper));
|
||||
return wrapper;
|
||||
}
|
||||
var devToolsConfig$jscomp$inline_1069 = {
|
||||
var devToolsConfig$jscomp$inline_1070 = {
|
||||
findFiberByHostInstance: function () {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-e5205658f-20230913",
|
||||
version: "18.3.0-canary-612b2b660-20230913",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1267 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1069.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1069.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1069.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1069.rendererConfig,
|
||||
var internals$jscomp$inline_1268 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1070.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1070.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1070.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1070.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -9067,26 +9070,26 @@ var internals$jscomp$inline_1267 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1069.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1070.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-e5205658f-20230913"
|
||||
reconcilerVersion: "18.3.0-canary-612b2b660-20230913"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1268 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1269 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1268.isDisabled &&
|
||||
hook$jscomp$inline_1268.supportsFiber
|
||||
!hook$jscomp$inline_1269.isDisabled &&
|
||||
hook$jscomp$inline_1269.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1268.inject(
|
||||
internals$jscomp$inline_1267
|
||||
(rendererID = hook$jscomp$inline_1269.inject(
|
||||
internals$jscomp$inline_1268
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1268);
|
||||
(injectedHook = hook$jscomp$inline_1269);
|
||||
} catch (err) {}
|
||||
}
|
||||
exports._Scheduler = Scheduler;
|
||||
@@ -9117,7 +9120,8 @@ exports.create = function (element, options) {
|
||||
isStrictMode,
|
||||
concurrentUpdatesByDefault,
|
||||
"",
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
);
|
||||
if (null == root) throw Error("something went wrong");
|
||||
updateContainer(element, root, null, null);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-canary-e5205658f-20230913";
|
||||
var ReactVersion = "18.3.0-canary-612b2b660-20230913";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
+1
-1
@@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-canary-e5205658f-20230913";
|
||||
exports.version = "18.3.0-canary-612b2b660-20230913";
|
||||
|
||||
+1
-1
@@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-canary-e5205658f-20230913";
|
||||
exports.version = "18.3.0-canary-612b2b660-20230913";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
e5205658f40ad181279857dbb66e36b8ebcd8c0e
|
||||
612b2b6601abb844248c384d1e288bb824b180b7
|
||||
|
||||
+14
-7
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<588595e62718a973abbe3ee5129ccaa8>>
|
||||
* @generated SignedSource<<01008a8950368c139ee32158a8728c5d>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -26929,7 +26929,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -26958,6 +26959,7 @@ function FiberRootNode(
|
||||
this.identifierPrefix = identifierPrefix;
|
||||
this.onRecoverableError = onRecoverableError;
|
||||
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
|
||||
{
|
||||
@@ -27000,7 +27002,8 @@ function createFiberRoot(
|
||||
// single type, like a DynamicHostConfig that is defined by the renderer.
|
||||
identifierPrefix,
|
||||
onRecoverableError,
|
||||
transitionCallbacks
|
||||
transitionCallbacks,
|
||||
formState
|
||||
) {
|
||||
// $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
|
||||
var root = new FiberRootNode(
|
||||
@@ -27008,7 +27011,8 @@ function createFiberRoot(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
);
|
||||
// stateNode is any.
|
||||
|
||||
@@ -27033,7 +27037,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-canary-8ee3c01f";
|
||||
var ReactVersion = "18.3.0-canary-f73f8a34";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -27177,7 +27181,9 @@ function createContainer(
|
||||
isStrictMode,
|
||||
concurrentUpdatesByDefaultOverride,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
transitionCallbacks,
|
||||
null
|
||||
);
|
||||
}
|
||||
function updateContainer(element, container, parentComponent, callback) {
|
||||
@@ -28005,7 +28011,8 @@ function render(element, containerTag, callback, concurrentRoot) {
|
||||
false,
|
||||
null,
|
||||
"",
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
);
|
||||
roots.set(containerTag, root);
|
||||
}
|
||||
|
||||
+8
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<fc10d7aa86eca62a04f26382a5f9893e>>
|
||||
* @generated SignedSource<<f4377d8ff1f66b2a641cbdfb6498eb2c>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -9172,7 +9172,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -9203,6 +9204,7 @@ function FiberRootNode(
|
||||
this.hiddenUpdates = createLaneMap(null);
|
||||
this.identifierPrefix = identifierPrefix;
|
||||
this.onRecoverableError = onRecoverableError;
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
}
|
||||
function createPortal$1(children, containerInfo, implementation) {
|
||||
@@ -9423,7 +9425,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1038 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-f14942e6",
|
||||
version: "18.3.0-canary-af8a5ec1",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -9466,7 +9468,7 @@ var internals$jscomp$inline_1280 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-f14942e6"
|
||||
reconcilerVersion: "18.3.0-canary-af8a5ec1"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1281 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -9545,7 +9547,8 @@ exports.render = function (element, containerTag, callback, concurrentRoot) {
|
||||
root,
|
||||
!1,
|
||||
"",
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
)),
|
||||
(root = createFiber(3, null, null, 1 === root ? 1 : 0)),
|
||||
(concurrentRoot.current = root),
|
||||
|
||||
+8
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<a6300003667849930958d1bcf4e085a9>>
|
||||
* @generated SignedSource<<6b16278436dd259e22a3d49533f17505>>
|
||||
*/
|
||||
|
||||
|
||||
@@ -9873,7 +9873,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -9904,6 +9905,7 @@ function FiberRootNode(
|
||||
this.hiddenUpdates = createLaneMap(null);
|
||||
this.identifierPrefix = identifierPrefix;
|
||||
this.onRecoverableError = onRecoverableError;
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
this.passiveEffectDuration = this.effectDuration = 0;
|
||||
this.memoizedUpdaters = new Set();
|
||||
@@ -10131,7 +10133,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1116 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-1e44ed5a",
|
||||
version: "18.3.0-canary-db5e081b",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -10187,7 +10189,7 @@ var roots = new Map(),
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-1e44ed5a"
|
||||
reconcilerVersion: "18.3.0-canary-db5e081b"
|
||||
});
|
||||
exports.createPortal = function (children, containerTag) {
|
||||
return createPortal$1(
|
||||
@@ -10253,7 +10255,8 @@ exports.render = function (element, containerTag, callback, concurrentRoot) {
|
||||
root,
|
||||
!1,
|
||||
"",
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
)),
|
||||
(root = 1 === root ? 1 : 0),
|
||||
isDevToolsPresent && (root |= 2),
|
||||
|
||||
+14
-7
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<3e32b2083b138b74caf4e294d5f1d5d6>>
|
||||
* @generated SignedSource<<f2e65ef4c8c0960e3b3015a92bd257ca>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -27443,7 +27443,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -27472,6 +27473,7 @@ function FiberRootNode(
|
||||
this.identifierPrefix = identifierPrefix;
|
||||
this.onRecoverableError = onRecoverableError;
|
||||
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
|
||||
{
|
||||
@@ -27514,7 +27516,8 @@ function createFiberRoot(
|
||||
// single type, like a DynamicHostConfig that is defined by the renderer.
|
||||
identifierPrefix,
|
||||
onRecoverableError,
|
||||
transitionCallbacks
|
||||
transitionCallbacks,
|
||||
formState
|
||||
) {
|
||||
// $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
|
||||
var root = new FiberRootNode(
|
||||
@@ -27522,7 +27525,8 @@ function createFiberRoot(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
);
|
||||
// stateNode is any.
|
||||
|
||||
@@ -27547,7 +27551,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-canary-848197bb";
|
||||
var ReactVersion = "18.3.0-canary-28a7f6a0";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -27691,7 +27695,9 @@ function createContainer(
|
||||
isStrictMode,
|
||||
concurrentUpdatesByDefaultOverride,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
transitionCallbacks,
|
||||
null
|
||||
);
|
||||
}
|
||||
function updateContainer(element, container, parentComponent, callback) {
|
||||
@@ -28513,7 +28519,8 @@ function render(element, containerTag, callback) {
|
||||
false,
|
||||
null,
|
||||
"",
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
null
|
||||
);
|
||||
roots.set(containerTag, root);
|
||||
}
|
||||
|
||||
+7
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<c2a8de7fa6f0edce3687e2a89c464bce>>
|
||||
* @generated SignedSource<<a21e07daf684cb26b4ce1acb9efc32aa>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -9421,7 +9421,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -9452,6 +9453,7 @@ function FiberRootNode(
|
||||
this.hiddenUpdates = createLaneMap(null);
|
||||
this.identifierPrefix = identifierPrefix;
|
||||
this.onRecoverableError = onRecoverableError;
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
}
|
||||
function createPortal$1(children, containerInfo, implementation) {
|
||||
@@ -9679,7 +9681,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1093 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-ca1379dc",
|
||||
version: "18.3.0-canary-38805935",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -9722,7 +9724,7 @@ var internals$jscomp$inline_1349 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-ca1379dc"
|
||||
reconcilerVersion: "18.3.0-canary-38805935"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1350 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -9781,7 +9783,7 @@ exports.getInspectorDataForInstance = getInspectorDataForInstance;
|
||||
exports.render = function (element, containerTag, callback) {
|
||||
var root = roots.get(containerTag);
|
||||
if (!root) {
|
||||
root = new FiberRootNode(containerTag, 0, !1, "", onRecoverableError);
|
||||
root = new FiberRootNode(containerTag, 0, !1, "", onRecoverableError, null);
|
||||
var JSCompiler_inline_result = createFiber(3, null, null, 0);
|
||||
root.current = JSCompiler_inline_result;
|
||||
JSCompiler_inline_result.stateNode = root;
|
||||
|
||||
+7
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<b76ec47e2228eaf84b8554f0948a2220>>
|
||||
* @generated SignedSource<<7d829b6bea14b03ca3f0800f7f1380e0>>
|
||||
*/
|
||||
|
||||
|
||||
@@ -10122,7 +10122,8 @@ function FiberRootNode(
|
||||
tag,
|
||||
hydrate,
|
||||
identifierPrefix,
|
||||
onRecoverableError
|
||||
onRecoverableError,
|
||||
formState
|
||||
) {
|
||||
this.tag = tag;
|
||||
this.containerInfo = containerInfo;
|
||||
@@ -10153,6 +10154,7 @@ function FiberRootNode(
|
||||
this.hiddenUpdates = createLaneMap(null);
|
||||
this.identifierPrefix = identifierPrefix;
|
||||
this.onRecoverableError = onRecoverableError;
|
||||
this.formState = formState;
|
||||
this.incompleteTransitions = new Map();
|
||||
this.passiveEffectDuration = this.effectDuration = 0;
|
||||
this.memoizedUpdaters = new Set();
|
||||
@@ -10387,7 +10389,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1171 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-6edff5a8",
|
||||
version: "18.3.0-canary-8bb18aca",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -10443,7 +10445,7 @@ var roots = new Map(),
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-6edff5a8"
|
||||
reconcilerVersion: "18.3.0-canary-8bb18aca"
|
||||
});
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
||||
computeComponentStackForErrorReporting: function (reactTag) {
|
||||
@@ -10489,7 +10491,7 @@ exports.getInspectorDataForInstance = getInspectorDataForInstance;
|
||||
exports.render = function (element, containerTag, callback) {
|
||||
var root = roots.get(containerTag);
|
||||
if (!root) {
|
||||
root = new FiberRootNode(containerTag, 0, !1, "", onRecoverableError);
|
||||
root = new FiberRootNode(containerTag, 0, !1, "", onRecoverableError, null);
|
||||
var JSCompiler_inline_result = 0;
|
||||
isDevToolsPresent && (JSCompiler_inline_result |= 2);
|
||||
JSCompiler_inline_result = createFiber(
|
||||
|
||||
Reference in New Issue
Block a user