File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 11"use client" ;
2-
32import { useState } from "react" ;
4- import Matchings from "~/components/match/matching" ;
5- import Requests from "~/components/match/requests" ;
3+
4+ // https://nextjs.org/docs/messages/react-hydration-error#solution-2-disabling-ssr-on-specific-components
5+ import dynamic from "next/dynamic" ;
6+ const NoSSRMatchings = dynamic ( ( ) => import ( "~/components/match/matching" ) , {
7+ ssr : false ,
8+ } ) ;
9+ const NoSSRRequests = dynamic ( ( ) => import ( "~/components/match/requests" ) , {
10+ ssr : false ,
11+ } ) ;
612
713export default function Friends ( ) {
814 const [ activeTab , setActiveTab ] = useState ( "matching" ) ;
@@ -39,7 +45,7 @@ export default function Friends() {
3945
4046 { /* コンテンツ部分 */ }
4147 < div className = "mt-4 text-center text-gray-700 text-lg" >
42- { activeTab === "matching" ? < Matchings /> : < Requests /> }
48+ { activeTab === "matching" ? < NoSSRMatchings /> : < NoSSRRequests /> }
4349 </ div >
4450 </ div >
4551 ) ;
Original file line number Diff line number Diff line change @@ -14,15 +14,11 @@ export default function Matchings() {
1414
1515 return (
1616 < div className = "p-4" >
17- < p className = "mr-10 ml-10 text-lg" >
18- { data && data . length === 0 && (
19- < >
20- 誰ともマッチングしていません。
21- < br />
22- リクエストを送りましょう!
23- </ >
24- ) }
25- </ p >
17+ { data && data . length === 0 && (
18+ < p className = "mr-10 ml-10 text-lg" >
19+ 誰ともマッチングしていません。 リクエストを送りましょう!
20+ </ p >
21+ ) }
2622 { current === "loading" ? (
2723 < FullScreenCircularProgress />
2824 ) : error ? (
You can’t perform that action at this time.
0 commit comments