@react-navigation/core 8.0.0-alpha.12 → 8.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/checkSerializable.js +11 -4
- package/lib/module/checkSerializable.js.map +1 -1
- package/lib/module/createNavigatorFactory.js.map +1 -1
- package/lib/module/getActionFromState.js +15 -2
- package/lib/module/getActionFromState.js.map +1 -1
- package/lib/module/getStateFromPath.js +61 -45
- package/lib/module/getStateFromPath.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/useEventEmitter.js +43 -31
- package/lib/module/useEventEmitter.js.map +1 -1
- package/lib/module/useNavigationBuilder.js +49 -48
- package/lib/module/useNavigationBuilder.js.map +1 -1
- package/lib/module/useRouteCache.js +2 -1
- package/lib/module/useRouteCache.js.map +1 -1
- package/lib/typescript/src/checkSerializable.d.ts +5 -3
- package/lib/typescript/src/checkSerializable.d.ts.map +1 -1
- package/lib/typescript/src/createNavigatorFactory.d.ts +2 -1
- package/lib/typescript/src/createNavigatorFactory.d.ts.map +1 -1
- package/lib/typescript/src/getActionFromState.d.ts.map +1 -1
- package/lib/typescript/src/getStateFromPath.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/useEventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useRouteCache.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/checkSerializable.tsx +22 -12
- package/src/createNavigatorFactory.tsx +13 -1
- package/src/getActionFromState.tsx +20 -4
- package/src/getStateFromPath.tsx +110 -70
- package/src/index.tsx +1 -1
- package/src/useEventEmitter.tsx +45 -36
- package/src/useNavigationBuilder.tsx +78 -79
- package/src/useRouteCache.tsx +2 -1
package/src/useRouteCache.tsx
CHANGED
|
@@ -36,9 +36,10 @@ export function useRouteCache<State extends NavigationState>(
|
|
|
36
36
|
proxy = routeWithoutState;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
39
|
+
if (process.env.NODE_ENV !== 'production' && proxy !== previous) {
|
|
40
40
|
// FIXME: since the state is updated with mutation, the route object cannot be frozen
|
|
41
41
|
// As a workaround, loop through the object and make the properties readonly
|
|
42
|
+
// Only needed once per proxy - skip if we're reusing a previously-frozen one
|
|
42
43
|
for (const key in proxy) {
|
|
43
44
|
// @ts-expect-error: this is fine since we are looping through the object
|
|
44
45
|
const value = proxy[key];
|