简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM