--- title: Actions order: 5 --- # Actions [MODES: data] ## Defining Actions Data mutations are done through Route actions defined on the `action` property of a route object. When the action completes, all loader data on the page is revalidated to keep your UI in sync with the data without writing any code to do it. ```tsx import { createBrowserRouter } from "react-router"; import { someApi } from "./api"; let router = createBrowserRouter([ { path: "/projects/:projectId", Component: Project, action: async ({ request }) => { let formData = await request.formData(); let title = formData.get("title"); let project = await someApi.updateProject({ title }); return project; }, }, ]); ``` ## Calling Actions Actions are called declaratively through `