Remix Fundamentals

Mutations Exercise

Kent C. Dodds

Kent C. Dodds

Professional Trainer
Remix Fundamentals

Check out a free preview of the full Remix Fundamentals course

The "Mutations Exercise" Lesson is part of the full, Remix Fundamentals course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to implement the new.tsx file by adding the action and creating a createPost function that accepts the title, slug, and markdown in the post.server.ts file.


Transcript from the "Mutations Exercise" Lesson

>> All right, let's go into exercise five. So we'll run node dev 5 and that should be on port 4005 except I want to be on the localhost variety. And then we'll go to the readme in 05. This is talking about mutations. So so far we've just been loading data and that's been pretty okay.

Most frameworks have that pretty well done. I like the way that remix does it but it's not really necessarily the value proposition. What makes remix really cool is mutations. And we also talked about [INAUDIBLE] that also makes [LAUGH] remix really cool but mutations is really special. So we're gonna talk about what it takes to make changes to your data.

We've got a bunch of stuff on the background you can read here. Some examples of how the mutation API and conventions work. And then for our exercise, we're gonna be implementing the new.tsx file. And actually if we go to app routes posts admin new, I actually filled this out with a bunch of JSX for you already because again, not a React workshop.

So have a good time with this one and we actually do have some extra credits. So we're gonna talk about error handling on the form as well as some more TypeScript stuff too. So have a good time with this and we'll see you on the other side of it.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now