Exercise: Identifying Server and Client Components in Routes
Welcome to the first exercise! These are meant to help solidify your knowledge.
Goal: This exercise will help you understand that some parts of a Remix route are run on the server only, while other parts run on the client.
Exercise: Below are descriptions of three key parts of a Remix route: the loader, the action, and the Component (the default export of a route file). Your task is to identify whether each of these components is part of the server build, the client build, or both. Provide a brief explanation for your choice.
- Loader Function: Used for data fetching on a route.
- Action Function: Handles form submissions and other HTTP POST requests.
- Route Component (Default Export): The React component that renders the UI of the route. It displays data and handles user interactions.
Tip: write down or type out your explanation! This will help you think through and retain the information.