From eac9dad35bc18ea1525431e6a3e2bcb06706dac5 Mon Sep 17 00:00:00 2001 From: Chafic Najjar Date: Tue, 8 Oct 2024 15:11:45 +0300 Subject: [PATCH] Fix "previous" and "next" navigation links (#2777) --- docs/apis/create-store.md | 2 +- docs/apis/create-with-equality-fn.md | 2 +- docs/apis/create.md | 2 +- docs/apis/shallow.md | 2 +- docs/guides/auto-generating-selectors.md | 2 +- docs/guides/connect-to-state-with-url-hash.md | 2 +- docs/guides/event-handler-in-pre-react-18.md | 2 +- docs/guides/flux-inspired-practice.md | 2 +- docs/guides/how-to-reset-state.md | 2 +- docs/guides/immutable-state-and-merging.md | 2 +- docs/guides/initialize-state-with-props.md | 2 +- docs/guides/maps-and-sets-usage.md | 2 +- docs/guides/nextjs.md | 2 +- docs/guides/practice-with-no-store-actions.md | 2 +- docs/guides/prevent-rerenders-with-use-shallow.md | 2 +- docs/guides/slices-pattern.md | 2 +- docs/guides/ssr-and-hydration.md | 2 +- docs/guides/testing.md | 2 +- docs/guides/typescript.md | 2 +- docs/guides/updating-state.md | 2 +- docs/hooks/use-shallow.md | 2 +- docs/hooks/use-store-with-equality-fn.md | 2 +- docs/hooks/use-store.md | 2 +- docs/integrations/immer-middleware.md | 2 +- docs/integrations/persisting-store-data.md | 2 +- docs/integrations/third-party-libraries.md | 2 +- docs/migrations/migrating-to-v4.md | 2 +- docs/migrations/migrating-to-v5.md | 2 +- docs/previous-versions/zustand-v3-create-context.md | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/apis/create-store.md b/docs/apis/create-store.md index d3aa92d3cb..5559548c22 100644 --- a/docs/apis/create-store.md +++ b/docs/apis/create-store.md @@ -1,7 +1,7 @@ --- title: createStore description: How to create vanilla stores -nav: 202 +nav: 24 --- `createStore` lets you create a vanilla store that exposes API utilities. diff --git a/docs/apis/create-with-equality-fn.md b/docs/apis/create-with-equality-fn.md index 4390b3607f..069128f777 100644 --- a/docs/apis/create-with-equality-fn.md +++ b/docs/apis/create-with-equality-fn.md @@ -1,7 +1,7 @@ --- title: createWithEqualityFn ⚛️ description: How to create efficient stores -nav: 203 +nav: 25 --- `createWithEqualityFn` lets you create a React Hook with API utilities attached, just like `create`. diff --git a/docs/apis/create.md b/docs/apis/create.md index cee7896060..8116592c9d 100644 --- a/docs/apis/create.md +++ b/docs/apis/create.md @@ -1,7 +1,7 @@ --- title: create ⚛️ description: How to create stores -nav: 204 +nav: 26 --- `create` lets you create a React Hook with API utilities attached. diff --git a/docs/apis/shallow.md b/docs/apis/shallow.md index eedba0fecc..6aefdd92c5 100644 --- a/docs/apis/shallow.md +++ b/docs/apis/shallow.md @@ -1,7 +1,7 @@ --- title: shallow description: How compare simple data effectively -nav: 209 +nav: 27 --- `shallow` lets you run fast checks on simple data structures. It effectively identifies changes in diff --git a/docs/guides/auto-generating-selectors.md b/docs/guides/auto-generating-selectors.md index 317a4604eb..64456b81d5 100644 --- a/docs/guides/auto-generating-selectors.md +++ b/docs/guides/auto-generating-selectors.md @@ -1,6 +1,6 @@ --- title: Auto Generating Selectors -nav: 6 +nav: 5 --- We recommend using selectors when using either the properties or actions from the store. You can access values from the store like so: diff --git a/docs/guides/connect-to-state-with-url-hash.md b/docs/guides/connect-to-state-with-url-hash.md index d006e6ec18..48a2df4d70 100644 --- a/docs/guides/connect-to-state-with-url-hash.md +++ b/docs/guides/connect-to-state-with-url-hash.md @@ -1,6 +1,6 @@ --- title: Connect to state with URL -nav: 12 +nav: 11 --- ## Connect State with URL Hash diff --git a/docs/guides/event-handler-in-pre-react-18.md b/docs/guides/event-handler-in-pre-react-18.md index d718756d41..7000e3d840 100644 --- a/docs/guides/event-handler-in-pre-react-18.md +++ b/docs/guides/event-handler-in-pre-react-18.md @@ -1,6 +1,6 @@ --- title: Calling actions outside a React event handler in pre React 18 -nav: 10 +nav: 9 --- Because React handles `setState` synchronously if it's called outside an event handler, updating the state outside an event handler will force react to update the components synchronously. Therefore, there is a risk of encountering the zombie-child effect. diff --git a/docs/guides/flux-inspired-practice.md b/docs/guides/flux-inspired-practice.md index c00b86741c..52ab32b8e8 100644 --- a/docs/guides/flux-inspired-practice.md +++ b/docs/guides/flux-inspired-practice.md @@ -1,6 +1,6 @@ --- title: Flux inspired practice -nav: 5 +nav: 4 --- Although Zustand is an unopinionated library, we do recommend a few patterns. diff --git a/docs/guides/how-to-reset-state.md b/docs/guides/how-to-reset-state.md index dd4aeb2497..a1fde74f06 100644 --- a/docs/guides/how-to-reset-state.md +++ b/docs/guides/how-to-reset-state.md @@ -1,6 +1,6 @@ --- title: How to reset state -nav: 13 +nav: 12 --- The following pattern can be used to reset the state to its initial value. diff --git a/docs/guides/immutable-state-and-merging.md b/docs/guides/immutable-state-and-merging.md index aa74ad0707..91e3b204c2 100644 --- a/docs/guides/immutable-state-and-merging.md +++ b/docs/guides/immutable-state-and-merging.md @@ -1,6 +1,6 @@ --- title: Immutable state and merging -nav: 4 +nav: 3 --- Like with React's `useState`, we need to update state immutably. diff --git a/docs/guides/initialize-state-with-props.md b/docs/guides/initialize-state-with-props.md index f162bf2f02..c32197048f 100644 --- a/docs/guides/initialize-state-with-props.md +++ b/docs/guides/initialize-state-with-props.md @@ -1,6 +1,6 @@ --- title: Initialize state with props -nav: 14 +nav: 13 --- In cases where [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) is needed, such as when a store should be initialized with props from a component, the recommended approach is to use a vanilla store with React.context. diff --git a/docs/guides/maps-and-sets-usage.md b/docs/guides/maps-and-sets-usage.md index dbf04a1886..f1800d4106 100644 --- a/docs/guides/maps-and-sets-usage.md +++ b/docs/guides/maps-and-sets-usage.md @@ -1,6 +1,6 @@ --- title: Map and Set Usage -nav: 11 +nav: 10 --- You need to wrap Maps and Sets inside an object. When you want its update to be reflected (e.g. in React), diff --git a/docs/guides/nextjs.md b/docs/guides/nextjs.md index e391a6743a..cb5828ef2f 100644 --- a/docs/guides/nextjs.md +++ b/docs/guides/nextjs.md @@ -1,6 +1,6 @@ --- title: Setup with Next.js -nav: 21 +nav: 17 --- [Next.js](https://nextjs.org) is a popular server-side rendering framework for React that presents diff --git a/docs/guides/practice-with-no-store-actions.md b/docs/guides/practice-with-no-store-actions.md index fe9061c4c3..d45da242c8 100644 --- a/docs/guides/practice-with-no-store-actions.md +++ b/docs/guides/practice-with-no-store-actions.md @@ -1,6 +1,6 @@ --- title: Practice with no store actions -nav: 7 +nav: 6 --- The recommended usage is to colocate actions and states within the store (let your actions be located together with your state). diff --git a/docs/guides/prevent-rerenders-with-use-shallow.md b/docs/guides/prevent-rerenders-with-use-shallow.md index 2b19a0dfa9..53d3b1a17e 100644 --- a/docs/guides/prevent-rerenders-with-use-shallow.md +++ b/docs/guides/prevent-rerenders-with-use-shallow.md @@ -1,6 +1,6 @@ --- title: Prevent rerenders with useShallow -nav: 16 +nav: 15 --- When you need to subscribe to a computed state from a store, the recommended way is to diff --git a/docs/guides/slices-pattern.md b/docs/guides/slices-pattern.md index c006bc93ae..7e8ad9cac6 100644 --- a/docs/guides/slices-pattern.md +++ b/docs/guides/slices-pattern.md @@ -1,6 +1,6 @@ --- title: Slices Pattern -nav: 15 +nav: 14 --- ## Slicing the store into smaller stores diff --git a/docs/guides/ssr-and-hydration.md b/docs/guides/ssr-and-hydration.md index 5e13ccd86e..b0f97512bc 100644 --- a/docs/guides/ssr-and-hydration.md +++ b/docs/guides/ssr-and-hydration.md @@ -1,6 +1,6 @@ --- title: SSR and Hydration -nav: 20 +nav: 16 --- ## Server-side Rendering (SSR) diff --git a/docs/guides/testing.md b/docs/guides/testing.md index 1436c1cd76..5912b73f12 100644 --- a/docs/guides/testing.md +++ b/docs/guides/testing.md @@ -1,7 +1,7 @@ --- title: Testing description: Writing Tests -nav: 9 +nav: 8 --- ## Setting Up a Test Environment diff --git a/docs/guides/typescript.md b/docs/guides/typescript.md index 29503595c5..4568a5a270 100644 --- a/docs/guides/typescript.md +++ b/docs/guides/typescript.md @@ -1,6 +1,6 @@ --- title: TypeScript Guide -nav: 8 +nav: 7 --- ## Basic usage diff --git a/docs/guides/updating-state.md b/docs/guides/updating-state.md index a036dae897..2ace6ff3f4 100644 --- a/docs/guides/updating-state.md +++ b/docs/guides/updating-state.md @@ -1,6 +1,6 @@ --- title: Updating state -nav: 3 +nav: 2 --- ## Flat updates diff --git a/docs/hooks/use-shallow.md b/docs/hooks/use-shallow.md index 607805a917..b66982a93b 100644 --- a/docs/hooks/use-shallow.md +++ b/docs/hooks/use-shallow.md @@ -1,7 +1,7 @@ --- title: useShallow ⚛️ description: How to memoize selector functions -nav: 211 +nav: 28 --- `useShallow` is a React Hook that lets you optimize re-renders. diff --git a/docs/hooks/use-store-with-equality-fn.md b/docs/hooks/use-store-with-equality-fn.md index a51142743c..33ef157d75 100644 --- a/docs/hooks/use-store-with-equality-fn.md +++ b/docs/hooks/use-store-with-equality-fn.md @@ -1,7 +1,7 @@ --- title: useStoreWithEqualityFn ⚛️ description: How to use vanilla stores effectively in React -nav: 212 +nav: 29 --- `useStoreWithEqualityFn` is a React Hook that lets you use a vanilla store in React, just like diff --git a/docs/hooks/use-store.md b/docs/hooks/use-store.md index 701827c480..e55b77792b 100644 --- a/docs/hooks/use-store.md +++ b/docs/hooks/use-store.md @@ -1,7 +1,7 @@ --- title: useStore ⚛️ description: How to use vanilla stores in React -nav: 213 +nav: 30 --- `useStore` is a React Hook that lets you use a vanilla store in React. diff --git a/docs/integrations/immer-middleware.md b/docs/integrations/immer-middleware.md index b29cc90b38..18f8c40527 100644 --- a/docs/integrations/immer-middleware.md +++ b/docs/integrations/immer-middleware.md @@ -1,6 +1,6 @@ --- title: Immer middleware -nav: 16 +nav: 18 --- The [Immer](https://github.com/immerjs/immer) middleware enables you diff --git a/docs/integrations/persisting-store-data.md b/docs/integrations/persisting-store-data.md index 715c36040f..398d0afa14 100644 --- a/docs/integrations/persisting-store-data.md +++ b/docs/integrations/persisting-store-data.md @@ -1,6 +1,6 @@ --- title: Persisting store data -nav: 17 +nav: 20 --- The Persist middleware enables you to store diff --git a/docs/integrations/third-party-libraries.md b/docs/integrations/third-party-libraries.md index 5b5bcb3b04..ae02e65844 100644 --- a/docs/integrations/third-party-libraries.md +++ b/docs/integrations/third-party-libraries.md @@ -1,6 +1,6 @@ --- title: Third-party Libraries -nav: 16 +nav: 19 --- Zustand provides bear necessities for state management. diff --git a/docs/migrations/migrating-to-v4.md b/docs/migrations/migrating-to-v4.md index f0243a67e0..1ef65ee88c 100644 --- a/docs/migrations/migrating-to-v4.md +++ b/docs/migrations/migrating-to-v4.md @@ -1,6 +1,6 @@ --- title: Migrating to v4 -nav: 19 +nav: 22 --- The only breaking changes are in types. diff --git a/docs/migrations/migrating-to-v5.md b/docs/migrations/migrating-to-v5.md index c4973d0637..adf4384f81 100644 --- a/docs/migrations/migrating-to-v5.md +++ b/docs/migrations/migrating-to-v5.md @@ -1,6 +1,6 @@ --- title: 'How to Migrate to v5 from v4' -nav: 30 +nav: 23 --- # How to Migrate to v5 from v4 diff --git a/docs/previous-versions/zustand-v3-create-context.md b/docs/previous-versions/zustand-v3-create-context.md index 710c0d9840..b241274ee3 100644 --- a/docs/previous-versions/zustand-v3-create-context.md +++ b/docs/previous-versions/zustand-v3-create-context.md @@ -1,6 +1,6 @@ --- title: createContext from zustand/context -nav: 18 +nav: 21 --- A special `createContext` is provided since v3.5,