Skip to content

Commit

Permalink
docs(start/tutorial): fix typo (#10187)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbuchoff authored Nov 4, 2024
1 parent b7d2801 commit 497aa9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@
- maxrchung
- maxschwarzmueller
- mbarto
- mbuchoff
- mcansh
- mccuna
- mdoury
Expand Down
6 changes: 3 additions & 3 deletions docs/start/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -958,12 +958,12 @@ At this point you should know everything you need to know to make the delete but
👉 **Create the "destroy" route module**

```shellscript nonumber
touch app/routes/contacts.\$contactId.destroy.tsx
touch app/routes/contacts.\$contactId_.destroy.tsx
```

👉 **Add the destroy action**

```tsx filename=app/routes/contacts.$contactId.destroy.tsx
```tsx filename=app/routes/contacts.$contactId_.destroy.tsx
import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import invariant from "tiny-invariant";
Expand All @@ -986,7 +986,7 @@ Alright, navigate to a record and click the "Delete" button. It works!
When the user clicks the submit button:

1. `<Form>` prevents the default browser behavior of sending a new document `POST` request to the server, but instead emulates the browser by creating a `POST` request with client side routing and [`fetch`][fetch]
2. The `<Form action="destroy">` matches the new route at `"contacts.$contactId.destroy"` and sends it the request
2. The `<Form action="destroy">` matches the new route at `contacts.$contactId_.destroy.tsx` and sends it the request
3. After the `action` redirects, Remix calls all the `loader`s for the data on the page to get the latest values (this is "revalidation"). `useLoaderData` returns new values and causes the components to update!

Add a `Form`, add an `action`, Remix does the rest.
Expand Down

0 comments on commit 497aa9a

Please sign in to comment.