You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let project =awaitfakeDb.createProject({ title });
110
+
returndata(project, { status: 201 });
111
+
} else {
112
+
let project =awaitfakeDb.updateProject({ title });
113
+
returnproject;
114
+
}
115
+
}
116
+
```
117
+
84
118
## Calling Actions
85
119
86
120
Actions are called declaratively through `<Form>` and imperatively through `useSubmit` (or `<fetcher.Form>` and `fetcher.submit`) by referencing the route's path and a "post" method.
@@ -159,4 +193,7 @@ fetcher.submit(
159
193
);
160
194
```
161
195
162
-
See the [Using Fetchers](../misc/fetchers) guide for more information.
196
+
See the [Using Fetchers][fetchers] guide for more information.
Copy file name to clipboardExpand all lines: docs/start/data-loading.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,35 @@ export default function Product({
65
65
66
66
Note that the `loader` function is removed from client bundles so you can use server only APIs without worrying about them being included in the browser.
67
67
68
+
### Custom Status Codes and Headers
69
+
70
+
If you need to return a custom HTTP status code or custom headers from your `loader`, you can do so using the [`data`][data] utility:
0 commit comments