-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from Atotti/hiro
Chapter18-20
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
unstable_noStoreを使って静的レンダリングをオプトアウトできる. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### ストリーミング | ||
ルートをより細かな部分に分割した「チャンク」を提供する技術 | ||
準備が整ったものから段階的にストリーミングされる | ||
|
||
#### 実装 | ||
ストリーミングをNextjsで実装する方法は次の2つ. | ||
- (ページレベル)`loading.tsx`ファイルを使う | ||
- (コンポーネントレベル)`<Suspense>`を使う | ||
|
||
#### loading.tsx | ||
`loading.tsx`を任意のルートに配置するだけ.これがフォールバックになってくれる | ||
|
||
##### ルートグループ | ||
ディレクトリ名に()で包んだ名前を使用すると次の効果がある. | ||
- URLにルーティングされなくなる | ||
- 親ディレクトリのページの要素として扱える | ||
これによって,`/app/dashboard/(overview)/loading.tsx`にdashboardのストリーミングのコンポーネントを書くことでdashboardにのみ影響させることができる(`loading.tsx`が`invoices`や`custmers`の親ディレクトリにはない扱いになる) | ||
|
||
#### <Suspense> | ||
`loading.tsx`のコンポーネント版 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
### Partial Pre-Rendering | ||
よくわかってないが,前章でやった`<Suspense>`を使うやつのこと? |