Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout.tsxを作成する #6

Open
2 tasks
Axafy5479 opened this issue Jun 4, 2024 · 3 comments
Open
2 tasks

layout.tsxを作成する #6

Axafy5479 opened this issue Jun 4, 2024 · 3 comments

Comments

@Axafy5479
Copy link
Contributor

Axafy5479 commented Jun 4, 2024

<notionのコメント>
image
↑その通りだと思います。そもそもヘッダーが不要かもしれない。

また一部ページではView, Editタブが不要なページが存在する可能性がある。またフッターの表示方法についても考えたい。

@Axafy5479
Copy link
Contributor Author

Axafy5479 commented Jun 6, 2024

<notionのコメント>
image

@Yokomi422
Copy link
Contributor

@Axafy5479
layout.tsxはデフォルトですべてのroutingされるものに反映されてしまうので、タイトルとそれ以外で分けるのは難しいと思いましたが、こちらを参照するといけそうですね

@Axafy5479
Copy link
Contributor Author

実装方法については考えられていなかったです。

multiple root layouts について読みました。

まとめると、

  • Route Group ごとにレイアウトを分けられる
  • app/layout.tsx は消す
  • (title)/content/page.tsxと(default)/content/page.tsxは、urlが衝突してエラー
  • 異なるレイアウト間の遷移は全コンテンツが再レンダリング。とはいえタイトルページからの遷移は初回だけなので、今回のケースではあまり問題にならない

といった感じでしょうか。
まさに特定ページのデザインだけ変えるための手法ですね。紹介ありがとうございます。

この機能を使うことになりそうなので、メンションさせてもらいます
@RRRyoma @NISHIYAMA-Takuki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants