Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
issueURL
#1
この PR で対応する範囲 / この PR で対応しない範囲
対応範囲
https://github.com/keitakn/ai-cat-prototype で作成した動作に必要なファイルを全て移植します。
未対応範囲
ESLintの設定ファイルなどは今回の移植対象外なので別issueで対応します。
Storybook の URL、 スクリーンショット
変更点概要
https://github.com/keitakn/ai-cat-prototype で作成したファイルのうち必要な物を移植。
ただし以下の2点は移植元から変更している。
ReactComponentの書き方
今回
React.FC
を使わない形にしてみた。きっかけは下記の記事を読んだ事。
Generics
が使いにくいという理由もあるので今回は使わない書き方をとりあえず試してみようと思った程度の理由。ただ
React.FC
の利用が必ずしもBad Practice とは思っていない。型を明示したほうがTypeScriptのトランスパイルのパフォーマンスが良いので
JSX.Element
を明示的に指定している。ディレクトリ構成について
偶然Next.jsの中の人のTweetを知った。
https://twitter.com/d151005/status/1659359491551547392?s=20
Next.jsの中の人いわく以下のように分けるのが良いらしいので今回はこの構成を試してみる事にした。
src/app/_components/
(汎用的に利用するComponent)src/app/◯◯/_components/
(対象ページでしか利用しないComponent)レビュアーに重点的にチェックして欲しい点
ReactComponentの書き方、ディレクトリ構成についての意見があれば聞きたい:pray:
補足情報
https://zenn.dev/link/comments/abeee4b126e37e