File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed
packages/plugin-rsc/examples/basic/src Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 1+ 'use client'
2+
3+ export function Mismatch ( ) {
4+ const value = typeof window !== 'undefined' ? 'browser' : 'ssr'
5+ return < > [{ value } ]</ >
6+ }
Original file line number Diff line number Diff line change 1+ import { Mismatch } from './client'
2+
3+ export function TestHydrationMismatch ( props : { url : URL } ) {
4+ const show = props . url . searchParams . has ( 'test-hydration-mismatch' )
5+ return (
6+ < div >
7+ < span > test-hydration-mismatch</ span > { ' ' }
8+ { show ? (
9+ < a href = "?" > hide</ a >
10+ ) : (
11+ < a href = "?test-hydration-mismatch" > show</ a >
12+ ) } { ' ' }
13+ { show && < Mismatch /> }
14+ </ div >
15+ )
16+ }
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import { TestTailwindClient } from './tailwind/client'
2727import { TestTailwindServer } from './tailwind/server'
2828import { TestTemporaryReference } from './temporary-reference/client'
2929import { TestUseCache } from './use-cache/server'
30+ import { TestHydrationMismatch } from './hydration-mismatch/server'
3031
3132export function Root ( props : { url : URL } ) {
3233 return (
@@ -47,6 +48,7 @@ export function Root(props: { url: URL }) {
4748 < TestCssClientNoSsr url = { props . url } />
4849 < TestTailwindClient />
4950 < TestTailwindServer />
51+ < TestHydrationMismatch url = { props . url } />
5052 < TestHmrClientDep />
5153 < TestTemporaryReference />
5254 < TestServerActionError />
Original file line number Diff line number Diff line change 99}
1010
1111a {
12- @apply text-gray-500 underline hover:text-gray-700;
12+ @apply text-gray-500 underline hover:text-gray-700 cursor-pointer ;
1313}
You can’t perform that action at this time.
0 commit comments