React Component Naming Conventions: Files, Props, and Hooks

5 min read

React has strong naming conventions that are enforced by JSX itself — components must start with an uppercase letter.

Components: PascalCase

All React components use PascalCase: UserProfile, ShoppingCart, NavBar. This is required — JSX treats lowercase tags as HTML elements.

Props: camelCase

Props use camelCase: userName, isLoading, onSubmit, maxRetries.

Hooks: use + PascalCase

Custom hooks start with use: useAuth, useFetch, useLocalStorage.

Event Handlers

Props: on + Event (onClick, onSubmit). Handler functions: handle + Event (handleClick, handleSubmit).

File Names

TypeConventionExample
ComponentPascalCaseUserProfile.tsx
HookcamelCaseuseAuth.ts
UtilitycamelCaseformatDate.ts
StylePascalCaseUserProfile.module.css
TestMatch sourceUserProfile.test.tsx

Convert Names

PascalCase converter for components, camelCase for props, or hub.