React Style Guide
Naming Conventions
File Names
Component files: Use CamelCase. E.g. MyComponent.js
Non-component files (like helpers, hooks, or utilities): Use kebab-case or camelCase. E.g. useCustomHook.js
or myUtility.js
.
Custom hooks files: with a use
prefix. E.g. useFetch.js
, useForm.js
.
Directory Names
Use kebab-case for folder names. E.g. my-folder
, components
, utils
.
Test folder name: __tests__