Naming conventions play a important role to improve code readability, maintainability, organization, and communication.
1. Pascal Case
+ First letter of each word is capitalized
+ No spaces or punctuation marks between the words
+ Using pascal case for below elements:
- React native component.
- Enumerations (Enums)
2. Camel case
+ Each word begin with a capital letter except the first word, which starts with a lowercase letter
+ Using camel case for below elements:
- Variable names
- Function name
- Object properties
- Custom hooks
eg: useBottomSheet() - Higher order component(HOCs)
eg: withAuthenticate()
3. Snake case
+ Uppercase letters, with words separated by underscores("_")
+ Using snake case for below cases:
- Constants
- Enumeration properties (properties name in snake case)
- Global variables
4. Higher order component
+ Use "with" as Prefix
+ Use "Original component" as Suffix
5. Custom hooks
+ Use "Behaviour of hook" as Suffix
6. Others
+ Use more descriptive and specific names
- Shouldn't:
0 Comments