React
React is a JavaScript library for building user interfaces, developed and maintained by Meta (Facebook). It's the most popular frontend library, powering countless web applications from startups to Fortune 500 companies.
Core Concepts
- Components: Reusable, composable building blocks
- JSX: JavaScript syntax extension for writing UI
- Virtual DOM: Efficient updates through diffing
- Hooks: Functions for state and lifecycle in function components
- Unidirectional data flow: Props down, events up
Essential Hooks
// State management
const [count, setCount] = useState(0);
// Side effects
useEffect(() => {
document.title = `Count: ${count}`;
}, [count]);
// Context consumption
const theme = useContext(ThemeContext);
// Memoization
const expensiveValue = useMemo(() => compute(data), [data]);
Ecosystem
React is a library, not a framework. You'll need additional tools:
| Need | Common Solutions |
|---|---|
| Routing | React Router, TanStack Router |
| State | Redux, Zustand, Jotai, Context |
| Data fetching | TanStack Query, SWR |
| Forms | React Hook Form, Formik |
| Styling | Tailwind, styled-components, CSS Modules |
| Meta-framework | Next.js, Remix |
What We Like
- Ecosystem: Largest library ecosystem of any framework
- Performance: Virtual DOM and concurrent features
- React Native: Share code with mobile apps
- Job market: Most in-demand frontend skill
- Flexibility: Choose your own tools and patterns
What We Don't Like
- JSX opinions: Some developers prefer templates
- Fast-moving: Best practices change frequently
- Boilerplate: State management can get verbose
- Decision fatigue: Many choices for common problems
When to Choose React
- Most web application projects
- Teams with JavaScript/TypeScript expertise
- Need for extensive third-party integrations
- Cross-platform ambitions (React Native)
- Projects requiring maximum flexibility
Getting Started
For new projects, we suggest starting with a minimal React boilerplate rather than a full meta-framework like Next.js, which is often overkill. This makes it easy to deploy to AWS Amplify or a simple S3/CloudFront hosting setup.