reactJS中的文件命名约定? [英] File naming conventions in reactJS?
问题描述
最近开始学习ReactJS,唯一让我困惑的是如何在react app目录中命名folders
和files
.
Recently I have started learning ReactJS, the only thing that confuses me is how to name folders
and files
in the react app directory.
为了命名component
文件,一些人跟随TitleCase.js
,少数人跟随camelCase.js
.
To name component
files a few people following TitleCase.js
and few following camelCase.js
.
命名应用程序 directories
很少有人关注 camelCase
和少数人small-case
或 small-case
To name app directories
few people following camelCase
and few
smallcase
or small-case
我试图在 ReactJS 中找到有关命名约定的官方文档,但找不到.有人可以帮我找到在 ReactJS 中命名文件的确切方法吗?提前致谢.
I tried to find the official documentation on naming conventions in ReactJS, but couldn't. can someone help me to find the exact way of naming files in ReactJS? Thanks in advance.
推荐答案
关于命名约定,ReactJS 没有意见.
Regarding naming conventions, ReactJS is unopinionated.
没有关于您提出的问题的官方指南或声明.您也不会在文档中找到它们.
There isn't an official guideline or statement about the questions you raised. You won't find them in the documentation either.
这是个人(团队)偏好.如果你努力执行一个,你可以坚持像 Airbnb 对 React 和 JSX 最合理的方法.
It's a personal (team) preference. If you struggle to enforce one, you could stick to something like Airbnb's mostly reasonable approach to React and JSX.
PS:只要你坚持,我就说你是安全的.
PS: As long as you're consistent, I would say you're safe.
这篇关于reactJS中的文件命名约定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!