Working with action data
The loader
and action
functions contain most of the business logic of our Remix application. This is where we fetch, filter, and update data. Both functions must return a Response
object. You know about the redirect
and json
helper functions, which let us create specific Response
objects, and you have already practiced working with loader data. In this section, we will learn how to work with action data. For that, we will update the expense details view and implement an edit expense form:
- Open the
dashboard.expenses.$id.tsx
route module in your editor. - Take the current code from
dashboard.expenses._index.tsx
. Can you modify the code to edit an existing expense? Give it a try!The final code for this chapter is available in the
/bee-rich/solution
folder on GitHub for this chapter. As we move forward, we'll help you align your work with this final solution. - Make sure to update the form's
action
property using theexpense
object from the...