Can i access Loader data in Action function in remix.run?

Viewed 640

Can I access the loader function data in remix inside action Function without passing it from the form or submit function.

something like using useLoaderData inside action Function.

1 Answers

No. useLoaderData and useActionData are both hooks used by the UI component once the data is returned from the loader/action.

You will either need to pass the data to the action via FormData, URLSearchParams, or URL params.

You can also store data in session or cookies and access it from your action.

Related