diff --git a/docs/components/await.md b/docs/components/await.md index 3e427aa1b48..682ee231282 100644 --- a/docs/components/await.md +++ b/docs/components/await.md @@ -1,5 +1,6 @@ --- title: Await +toc: false --- # `` diff --git a/docs/components/form.md b/docs/components/form.md index 01dbf31e5b4..31aedd02aa0 100644 --- a/docs/components/form.md +++ b/docs/components/form.md @@ -4,10 +4,10 @@ title: Form # `
` -Watch the 📼 Remix Singles: Data Mutations with Form + action, Multiple Forms and Single Button Mutations and Clearing Inputs After Form Submissions - This component is simply a re-export of [React Router's `Form`][rr-form]. +Watch the 📼 Remix Singles: Data Mutations with Form + action, Multiple Forms and Single Button Mutations and Clearing Inputs After Form Submissions + The `` component is a declarative way to perform data mutations: creating, updating, and deleting data. While it might be a mind-shift to think about these tasks as "navigation", it's how the web has handled mutations since before JavaScript was created! ```tsx @@ -94,7 +94,7 @@ When the `action` prop is omitted, `` and `` will sometimes call dif - `` uses the current URL as the default which can lead to surprising results: forms inside parent routes will post to the child action if you're at the child's URL and the parents action when you're at the parent's URL. This means as the user navigates, the form's behavior changes. - `` will always post to the route's action, independent of the URL. A form in a parent route will always post to the parent, even if you're at the child's URL. -For more information and usage, please refer to the [React Router `Form` docs][rr-form]. +For more information and usage, please refer to the [React Router `Form` docs][rr-form]. See also: diff --git a/docs/components/links.md b/docs/components/links.md index ed0ec9ed6d6..10d8f3a4b0c 100644 --- a/docs/components/links.md +++ b/docs/components/links.md @@ -1,5 +1,6 @@ --- title: Links +toc: false --- # `` diff --git a/docs/components/live-reload.md b/docs/components/live-reload.md index b8f995d2a35..912e8617b8a 100644 --- a/docs/components/live-reload.md +++ b/docs/components/live-reload.md @@ -1,5 +1,6 @@ --- title: LiveReload +toc: false --- # `` diff --git a/docs/components/meta.md b/docs/components/meta.md index 7ea0da7118d..dad74218f87 100644 --- a/docs/components/meta.md +++ b/docs/components/meta.md @@ -1,5 +1,6 @@ --- title: Meta +toc: false --- # `` diff --git a/docs/components/nav-link.md b/docs/components/nav-link.md index bba55832252..4b01edc80ab 100644 --- a/docs/components/nav-link.md +++ b/docs/components/nav-link.md @@ -1,5 +1,6 @@ --- title: NavLink +toc: false --- # `` diff --git a/docs/components/outlet.md b/docs/components/outlet.md index 376dfbdb6f9..d0b481392d5 100644 --- a/docs/components/outlet.md +++ b/docs/components/outlet.md @@ -1,9 +1,10 @@ --- title: Outlet +toc: false --- # `` -This is simply a re-export of [React Router's `Outlet`][rr-outlet]. +This component is simply a re-export of [React Router's `Outlet`][rr-outlet]. [rr-outlet]: https://reactrouter.com/components/outlet diff --git a/docs/components/prefetch-page-links.md b/docs/components/prefetch-page-links.md index 63d01b0833c..b791d6ff4d9 100644 --- a/docs/components/prefetch-page-links.md +++ b/docs/components/prefetch-page-links.md @@ -1,5 +1,6 @@ --- title: PrefetchPageLinks +toc: false --- # `` diff --git a/docs/components/scripts.md b/docs/components/scripts.md index 2a7051a4e44..5cf4c7c39f0 100644 --- a/docs/components/scripts.md +++ b/docs/components/scripts.md @@ -1,5 +1,6 @@ --- title: Scripts +toc: false --- # `` diff --git a/docs/file-conventions/entry.client.md b/docs/file-conventions/entry.client.md index c0a35fdd4ec..aee58581922 100644 --- a/docs/file-conventions/entry.client.md +++ b/docs/file-conventions/entry.client.md @@ -1,5 +1,6 @@ --- title: entry.client +toc: false --- # entry.client diff --git a/docs/file-conventions/entry.server.md b/docs/file-conventions/entry.server.md index a6c6d3f9e84..91a4e244c93 100644 --- a/docs/file-conventions/entry.server.md +++ b/docs/file-conventions/entry.server.md @@ -1,5 +1,6 @@ --- title: entry.server +toc: false --- # entry.server diff --git a/docs/file-conventions/root.md b/docs/file-conventions/root.md index 605321a1cb4..062c1fb6150 100644 --- a/docs/file-conventions/root.md +++ b/docs/file-conventions/root.md @@ -1,5 +1,6 @@ --- title: root +toc: false --- # Root Route diff --git a/docs/guides/bff.md b/docs/guides/bff.md index 5d7bf3fa10a..01ce8401bd2 100644 --- a/docs/guides/bff.md +++ b/docs/guides/bff.md @@ -1,5 +1,6 @@ --- title: Backend For Frontend +toc: false --- # Backend For Your Frontend diff --git a/docs/guides/streaming.md b/docs/guides/streaming.md index a834f72a854..25a86dae599 100644 --- a/docs/guides/streaming.md +++ b/docs/guides/streaming.md @@ -25,14 +25,11 @@ export async function loader({ params }: LoaderArgs) { params.packageId ); - return json({ - packageLocation, - }); + return json({ packageLocation }); } export default function PackageRoute() { - const data = useLoaderData(); - const { packageLocation } = data; + const { packageLocation } = useLoaderData(); return (
diff --git a/docs/guides/typescript.md b/docs/guides/typescript.md index 0a79ca99834..83712a8cc86 100644 --- a/docs/guides/typescript.md +++ b/docs/guides/typescript.md @@ -1,5 +1,6 @@ --- title: TypeScript +toc: false --- # TypeScript diff --git a/docs/hooks/use-action-data.md b/docs/hooks/use-action-data.md index d10724f9ae6..6dfaf5cc0f6 100644 --- a/docs/hooks/use-action-data.md +++ b/docs/hooks/use-action-data.md @@ -1,9 +1,12 @@ --- title: useActionData +toc: false --- # `useActionData` +This hook is simply a re-export of [React Router's `useActionData`][rr-useactiondata]. + This hook returns the JSON parsed data from your route action. It returns `undefined` if there hasn't been a submission at the current location yet. ```tsx lines=[3,12,21] @@ -151,6 +154,8 @@ If you're using `` and don't care to support the cases above, you don't ne In general, if the form validation fails, return data from the action and render it in the component. But, once you actually change data (in your database, or otherwise), you should redirect. +For more information and usage, please refer to the [React Router `useActionData` docs][rr-useactiondata]. + See also: - [`action`][action] @@ -158,3 +163,4 @@ See also: [action]: ../route/action [usetransition]: ../hooks/use-transition +[rr-useactiondata]: https://reactrouter.com/hooks/use-action-data diff --git a/docs/hooks/use-before-unload.md b/docs/hooks/use-before-unload.md index 9bdb014a3a5..6a0fb1d2065 100644 --- a/docs/hooks/use-before-unload.md +++ b/docs/hooks/use-before-unload.md @@ -39,6 +39,6 @@ function SomeForm() { } ``` -For more information and usage, please refer to the [React Router `useBeforeUnload` docs][rr-usebeforeunload]. +For more information and usage, please refer to the [React Router `useBeforeUnload` docs][rr-usebeforeunload]. [rr-usebeforeunload]: https://reactrouter.com/hooks/use-before-unload diff --git a/docs/hooks/use-fetchers.md b/docs/hooks/use-fetchers.md index bc5a8fdb599..1422f3b3ca3 100644 --- a/docs/hooks/use-fetchers.md +++ b/docs/hooks/use-fetchers.md @@ -1,5 +1,6 @@ --- title: useFetchers +toc: false --- # `useFetchers` diff --git a/docs/hooks/use-form-action.md b/docs/hooks/use-form-action.md index 05cec6f74af..3f3c9e59e86 100644 --- a/docs/hooks/use-form-action.md +++ b/docs/hooks/use-form-action.md @@ -23,6 +23,6 @@ function SomeComponent() { (Yes, HTML buttons can change the action of their form!) -For more information and usage, please refer to the [React Router `useFormAction` docs][rr-useformaction]. +For more information and usage, please refer to the [React Router `useFormAction` docs][rr-useformaction]. [rr-useformaction]: https://reactrouter.com/hooks/use-form-action diff --git a/docs/hooks/use-loader-data.md b/docs/hooks/use-loader-data.md index 7b5311328b0..8b22b77d973 100644 --- a/docs/hooks/use-loader-data.md +++ b/docs/hooks/use-loader-data.md @@ -1,9 +1,12 @@ --- title: useLoaderData +toc: false --- # `useLoaderData` +This hook is simply a re-export of [React Router's `useLoaderData`][rr-useloaderdata]. + Watch the 📼 Remix Single: Loading data into components This hook returns the JSON parsed data from your route loader function. @@ -21,3 +24,7 @@ export default function Invoices() { // ... } ``` + +For more information and usage, please refer to the [React Router `useLoaderData` docs][rr-useloaderdata]. + +[rr-useloaderdata]: https://reactrouter.com/hooks/use-loader-data diff --git a/docs/hooks/use-matches.md b/docs/hooks/use-matches.md index 8f539a1f1f3..7a9c40a41a6 100644 --- a/docs/hooks/use-matches.md +++ b/docs/hooks/use-matches.md @@ -1,5 +1,6 @@ --- title: useMatches +toc: false --- # `useMatches` diff --git a/docs/hooks/use-navigation.md b/docs/hooks/use-navigation.md index 03f619cd70f..620620d5f09 100644 --- a/docs/hooks/use-navigation.md +++ b/docs/hooks/use-navigation.md @@ -20,6 +20,6 @@ function SomeComponent() { } ``` -For more information and usage, please refer to the [React Router `useNavigation` docs][rr-usenavigation]. +For more information and usage, please refer to the [React Router `useNavigation` docs][rr-usenavigation]. [rr-usenavigation]: https://reactrouter.com/hooks/use-navigation diff --git a/docs/hooks/use-revalidator.md b/docs/hooks/use-revalidator.md index 79c488fd44a..6067d265adf 100644 --- a/docs/hooks/use-revalidator.md +++ b/docs/hooks/use-revalidator.md @@ -1,5 +1,6 @@ --- title: useRevalidator +toc: false --- # `useRevalidator` @@ -26,6 +27,6 @@ function WindowFocusRevalidator() { } ``` -For more information and usage, please refer to the [React Router `useRevalidator` docs][rr-userevalidator]. +For more information and usage, please refer to the [React Router `useRevalidator` docs][rr-userevalidator]. [rr-userevalidator]: https://reactrouter.com/hooks/use-revalidator diff --git a/docs/hooks/use-route-loader-data.md b/docs/hooks/use-route-loader-data.md index 6a8ed85e73a..039e439ed47 100644 --- a/docs/hooks/use-route-loader-data.md +++ b/docs/hooks/use-route-loader-data.md @@ -25,6 +25,6 @@ Remix creates the route IDs automatically. They are simply the path of the route | `app/routes/teams.tsx` | `"routes/teams"` | | `app/routes/teams.$id.jsx` | `"routes/teams.$id"` | -For more information and usage, please refer to the [React Router `useRouteLoaderData` docs][rr-userouteloaderdata]. +For more information and usage, please refer to the [React Router `useRouteLoaderData` docs][rr-userouteloaderdata]. [rr-userouteloaderdata]: https://reactrouter.com/hooks/use-route-loader-data diff --git a/docs/hooks/use-submit.md b/docs/hooks/use-submit.md index 522e41bb72f..6e03cae32e8 100644 --- a/docs/hooks/use-submit.md +++ b/docs/hooks/use-submit.md @@ -1,5 +1,6 @@ --- title: useSubmit +toc: false --- # `useSubmit` @@ -71,6 +72,6 @@ function useSessionTimeout() { } ``` -For more information and usage, please refer to the [React Router `useSubmit` docs][rr-usesubmit]. +For more information and usage, please refer to the [React Router `useSubmit` docs][rr-usesubmit]. [rr-usesubmit]: https://reactrouter.com/hooks/use-submit diff --git a/docs/other-api/asset-imports.md b/docs/other-api/asset-imports.md index 697d3f7cdfb..db32892d9f8 100644 --- a/docs/other-api/asset-imports.md +++ b/docs/other-api/asset-imports.md @@ -1,5 +1,6 @@ --- title: Asset Imports +toc: false --- # Asset URL Imports diff --git a/docs/other-api/node.md b/docs/other-api/node.md index 458715a034f..c43c65280cb 100644 --- a/docs/other-api/node.md +++ b/docs/other-api/node.md @@ -2,7 +2,9 @@ title: "@remix-run/node" --- -This contains utilities and polyfills for Node.js. +# `@remix-run/node` + +This package contains utilities and polyfills for Node.js. Most of the time you will never be importing from this package directly as it's used internally by adapters such as `@remix-run/express`. diff --git a/docs/other-api/serve.md b/docs/other-api/serve.md index 0d16aa527c2..3c2d4c7627d 100644 --- a/docs/other-api/serve.md +++ b/docs/other-api/serve.md @@ -1,5 +1,6 @@ --- title: "@remix-run/serve" +toc: false order: 3 --- diff --git a/docs/utils/defer.md b/docs/utils/defer.md index 686782f3583..e5f91366f10 100644 --- a/docs/utils/defer.md +++ b/docs/utils/defer.md @@ -1,5 +1,6 @@ --- title: defer +toc: false --- # `defer` @@ -7,10 +8,9 @@ title: defer This is a shortcut for creating a streaming/deferred response. It assumes you are using `utf-8` encoding. From a developer perspective it behaves just like [`json()`][json], but with the ability to transport promises to your UI components. ```ts lines=[2,5,10] -import type { LoaderFunction } from "@remix-run/node"; // or cloudflare/deno import { defer } from "@remix-run/node"; // or cloudflare/deno -export const loader: LoaderFunction = async () => { +export const loader = async () => { const aStillRunningPromise = loadSlowDataAsync(); // So you can write this without awaiting the promise: @@ -24,7 +24,7 @@ export const loader: LoaderFunction = async () => { You can also pass a status code and headers: ```ts lines=[9-14] -export const loader: LoaderFunction = async () => { +export const loader = async () => { const aStillRunningPromise = loadSlowDataAsync(); return defer( diff --git a/docs/utils/json.md b/docs/utils/json.md index 6b947cbd24b..4900aac0af3 100644 --- a/docs/utils/json.md +++ b/docs/utils/json.md @@ -1,5 +1,6 @@ --- title: json +toc: false --- # `json` diff --git a/docs/utils/redirect.md b/docs/utils/redirect.md index 14a6b4e72c1..b3000dca189 100644 --- a/docs/utils/redirect.md +++ b/docs/utils/redirect.md @@ -1,5 +1,6 @@ --- title: redirect +toc: false --- # `redirect` diff --git a/docs/utils/unstable-create-file-upload-handler.md b/docs/utils/unstable-create-file-upload-handler.md index 4c0e3948dac..72a06b7404e 100644 --- a/docs/utils/unstable-create-file-upload-handler.md +++ b/docs/utils/unstable-create-file-upload-handler.md @@ -1,5 +1,6 @@ --- title: unstable_createFileUploadHandler +toc: false --- # `unstable_createFileUploadHandler` diff --git a/docs/utils/unstable-create-memory-upload-handler.md b/docs/utils/unstable-create-memory-upload-handler.md index 6d35f5ca1c0..a7834dc9765 100644 --- a/docs/utils/unstable-create-memory-upload-handler.md +++ b/docs/utils/unstable-create-memory-upload-handler.md @@ -1,5 +1,6 @@ --- title: unstable_createMemoryUploadHandler +toc: false --- # `unstable_createMemoryUploadHandler`