Load and Display Static Data with Remix loaders

InstructorIan Jones

Share this video with your friends

Send Tweet

The first thing you do is install Remix! In this course, you start with a barebones Remix set up. In many situations you will start with a Remix stack but this course starts from the beginning.

Installing Remix is easy though, so you will finish this lesson by being introduced to a core Remix feature: data loaders.

Remix loaders are functions that only run on the server so you are safe to connect to databases, make API calls, and anything else you’d expect to do on a server. The data you return from these functions will be received into your components through useLoaderData hooks.

We’ll see how to return static data from a loader and display it in a component. Along the way, TypeScript will complain about data that is coming into your component so we will fix that as well.

Josh Branchaud
~ a year ago

When you specify the type of useLoaderData, does that automatically align with or check against the return type of the loader function?