Project name
name can no longer contain capital letters.
Components
PascalCase (capitalizing the first letter of each word) for component names.)
Files
PascalCase, matching the component name.
Props
Use descriptive names for props to clearly indicate their purpose.
** Avoid abbreviations or acronyms unless they are widely understood in the context of your project.
For example - instead of usr, use user.
State variables
Prefix state variables with is, has, or should to denote boolean values.
Event handlers
Use handle as a prefix for event handler functions.
For example, handleClick, handleInputChange.
CSS classes
Use lowercase letters and hyphens for CSS class names.
Constants
Use uppercase letters with underscores to represent constants in JavaScript.
For example, API_URL, MAX_RESULTS.
Utility functions
use camelCase for utility functions or helper functions.
Ref :
'개발 > React' 카테고리의 다른 글
[React] 프로젝트 시작 & git repository 연결 (1) | 2024.05.21 |
---|