Skip to content
Justice Tech School

Import and Export

Split components into files with default and named exports.

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

Default import.

 Button from "./Button";

Quiz Test

How many default exports per file?

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