Comments (3)
大きいコンポーネントは分割しよう
大きいコーポーネントや大きい関数は可読性が下がる
→ メンテナンスがしにくい、他の人や未来の自分が読めなくなるなどのデメリット
基本的には「感覚で」大きいと思ったらコンポーネントを分けた方が良い
判断基準の一つ:2週間後の自分が読めるかどうか
コンポーネントを分割した場合、それぞれのコンポーネントを同一ファイルに記述するか、別のファイルに記述するか、のどちらかになる
別のファイルに記述するメリット
名前空間が別になる
別のファイルに記述するデメリット
めんどくさい、チェックしにくい(でも同じディレクトリならそのデメリットも小さい、巨大プロジェクトで遠くのディレクトリとかに入れるとしんどい)
でもそれは結局プロジェクト次第
from self-study.
PredictionGeeks開発の手順(React開発)
- branch変更(branchで作業してmasterにPR、productionブランチは触らない)
- branchの命名:[種類]/[front or back]/[内容]
- 例:fix/frontend/character-size
yarn dev
→ これで保存すればlocalhost3000でリアルタイムに変更確認可能- package.jsonがあるディレクトリで実行する
- 開発終了後、
yarn lint
yarn format
yarn typecheck
を叩いて、コードをチェック git add
git commit
git push
してPRを送る
from self-study.
Reactアプリ、フォルダ名・構成の変更
プロジェクトの名前変更
フォルダ名の変更+package.json
のname
を変更
参照:How can I change ReactJS Project (folder) name?
from self-study.
Related Issues (11)
- React + TypeScript開発で調べたことのまとめ HOT 28
- JavaScriptに関して調べたことのまとめ HOT 16
- PATHのお話 HOT 2
- いろいろな概念・用語 HOT 4
- Dockerについて HOT 5
- CSSとか、CSS in JSとか HOT 14
- Node.jsについて HOT 3
- Terraformについて HOT 4
- AWSとか HOT 3
- GitHub Actionsについて
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from self-study.