Skip to content
Justice Tech School

Importing and Exporting Components

Put each component in its own file, export it and import it where needed. Default exports are imported without braces, named exports with braces.

Example
// Button.jsx
export default function Button() { return <button>Go</button>; }
export const Small = () => <button>s</button>;

// App.jsx
import Button, { Small } from './Button';

Exercise

Import a default export.

import Button  "./Button"

Quiz Test

Named exports are imported with?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.