Design

Building with Components

Why React components?

React’s component architecture simplifies building large websites by encouraging
modularity, reusability, and clear abstractions. React has a large ecosystem of
open source components, tutorials, and tooling that can be used seamlessly for
building sites with Gatsby. Gatsby is built to behave almost exactly like a
normal React application.

Thinking in React
is a good resource for learning how to structure applications with React.

Page components

Components under src/pages become pages automatically with paths based on
their file name. For example src/pages/index.jsx is mapped to yoursite.com
and src/pages/about.jsx becomes yoursite.com/about/. Every .js or .jsx
file in the pages directory must resolve to either a string or react component,
otherwise your build will fail.