Full Stack Foundations - Data Loading

    Data can be loaded via loader resource, and unpacked with Remix json method. In the UI get it via useLoaderData hook. Loader runs on the server and we're able to return data from the server into the UI. Also we're able to filter out only data that we want in the UI, not the entire object. Important to handle missing data and show a more helpful error message other than 500 error. Use invariantResponse helper which uses throw new Response mechanism. This will address errors in the Network tab, not in the UI, that will be later.

    epicnotes