我可以在remix.run中访问“操作功能”中的加载程序数据?
我可以在操作功能内部混音中访问加载程序功能数据,而无需从表单或提交功能传递。
类似于在动作功能中使用Useloaderdata。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编号
USELOADERDATA
和UseActionData
都是UI组件使用的挂钩,一旦从加载程序/操作返回数据。您将需要通过FormData,urlsearchParams或URL参数将数据传递到操作中。
您还可以将数据存储在会话或cookie中,并可以从操作中访问。
No.
useLoaderData
anduseActionData
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.