Replies: 2 comments 1 reply
-
export const loader = async (args: LoaderFunctionArgs) => { ... }
export const action = async (args: ActionFunctionArgs) => { ... } |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hopefully this saves some time for others: import { type HeadersArgs } from '@remix-run/node';
import { type ActionFunctionArgs } from '@remix-run/node';
import { type LoaderFunctionArgs } from '@remix-run/node';
import { unstable_data } from '@remix-run/node';
export const defineAction =
<T>(action: (args: ActionFunctionArgs) => T) =>
(args: ActionFunctionArgs) => {
return action(args);
};
export const defineLoader =
<T>(loader: (args: LoaderFunctionArgs) => T) =>
(args: LoaderFunctionArgs) => {
return loader(args);
};
export const defineHeaders =
(headers: (args: HeadersArgs) => Headers | HeadersInit) =>
(args: HeadersArgs) => {
return headers(args);
};
export const defineData = unstable_data; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How do I type loaders/actions now that these are removed?
Beta Was this translation helpful? Give feedback.
All reactions