Skip to content

Commit

Permalink
docs(framework): update Next.js and Svelte documentation links (#8572)
Browse files Browse the repository at this point in the history
* docs(svelte): fix writable stores tutorial link

Update the Svelte stores tutorial link to the correct URL in the Svelte Query overview documentation.

The previous link to writable-stores was broken or outdated.

* docs(ssr): update Next.js documentation links to latest version

Update outdated Next.js documentation links in the SSR guide to point to
the latest App Router documentation paths, ensuring users are directed to
the most current and relevant documentation.

Links updated:
- rewrites feature
- automatic static optimization
- rewrite parameters
  • Loading branch information
ohansFavour authored Jan 23, 2025
1 parent cd88c9c commit 322760b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/framework/react/guides/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,6 @@ Alternatively, you can set a smaller `gcTime`.

### Caveat for Next.js rewrites

There's a catch if you're using [Next.js' rewrites feature](https://nextjs.org/docs/api-reference/next.config.js/rewrites) together with [Automatic Static Optimization](https://nextjs.org/docs/advanced-features/automatic-static-optimization) or `getStaticProps`: It will cause a second hydration by React Query. That's because [Next.js needs to ensure that they parse the rewrites](https://nextjs.org/docs/api-reference/next.config.js/rewrites#rewrite-parameters) on the client and collect any params after hydration so that they can be provided in `router.query`.
There's a catch if you're using [Next.js' rewrites feature](https://nextjs.org/docs/app/api-reference/next-config-js/rewrites) together with [Automatic Static Optimization](https://nextjs.org/docs/pages/building-your-application/rendering/automatic-static-optimization) or `getStaticProps`: It will cause a second hydration by React Query. That's because [Next.js needs to ensure that they parse the rewrites](https://nextjs.org/docs/app/api-reference/next-config-js/rewrites#rewrite-parameters) on the client and collect any params after hydration so that they can be provided in `router.query`.

The result is missing referential equality for all the hydration data, which for example triggers wherever your data is used as props of components or in the dependency array of `useEffect`s/`useMemo`s.
2 changes: 1 addition & 1 deletion docs/framework/svelte/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ Svelte Query offers useful functions and components that will make managing serv

Svelte Query offers an API similar to React Query, but there are some key differences to be mindful of.

- Many of the functions in Svelte Query return a Svelte store. To access values on these stores reactively, you need to prefix the store with a `$`. You can learn more about Svelte stores [here](https://svelte.dev/tutorial/writable-stores).
- Many of the functions in Svelte Query return a Svelte store. To access values on these stores reactively, you need to prefix the store with a `$`. You can learn more about Svelte stores [here](https://learn.svelte.dev/tutorial/writable-stores).
- If your query or mutation depends on variables, you must use a store for the options. You can read more about this [here](../reactivity).

0 comments on commit 322760b

Please sign in to comment.