1. Creating a Loader
To do this, we will create a loader separate from the section, in theloaders/
folder of your project.
Create the file DogFactsLoader.ts
in the loaders/
folder of your project. It
will have the same logic as the loader we have created in the previous tutorial,
but we have to remember to define the Props interface and export the loader as
default.
2. Using the Loader in a Section
Now that we have created the loader, we can use it in a section. The important thing to note here is that one of the props of the section should match the return type of the loader. Modify theDogFacts.tsx
file in the sections/
folder of your project.
