Naming convention #30
jinmayamashita
started this conversation in
General
Replies: 1 comment
-
@yannde Is there any other content you would like to recommend? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's start with a simple discussion (About custom hook and component names).
Any feedback would be appreciated!
custom hook
use camelCase for filenames.
According to the React docs, A custom Hook is a JavaScript function whose name starts with ”use” and that may call other Hooks.
functional component (and class component)
use PascalCase for filenames.
this is how React differentiates between built-in components (e.g html elements) and a our component.
Also, the name of the component refers to its responsibilities.
Other functions should be filenames of camel case.
Beta Was this translation helpful? Give feedback.
All reactions