reactJS中的文件命名约定? [英] File naming conventions in reactJS?

查看:37
本文介绍了reactJS中的文件命名约定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近开始学习ReactJS,唯一让我困惑的是如何在react app目录中命名foldersfiles.

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-casesmall-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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆