Closed zspitz closed 1 month ago
@zspitz it's just a preference, you can do either one.
Many people like to return an object because it's easy to add more data later
By the way, if you have feedback or corrections to the docs, the source is in the remix repo
The first loader introduced in the tutorial returns
contacts
wrapped in an object.which is then destructured from
useLoaderData
:Why not return
contacts
directly from the loader?Same for creating a contact, getting a contact