Skip to content

Commit bcb4127

Browse files
committed
test: update ssr test
1 parent 4ac7b3b commit bcb4127

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/routes/ssr-test/+page.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
export let data;
55
</script>
66

7-
<h1>Not Hydrated: {data.title}</h1>
7+
<h1>Not Hydrated: {data?.title}</h1>
88

9-
<Doc ref="posts/first-post" startWith={data} let:data={realtimeData}>
10-
<h1>Hydrated: {realtimeData.title}</h1>
9+
<Doc ref="posts/test" startWith={data} let:data={realtimeData}>
10+
<h1>Hydrated: {realtimeData?.title}</h1>
1111
</Doc>
1212

1313
<p>

src/routes/ssr-test/+page.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { doc, getDoc } from 'firebase/firestore';
22
import { db } from '../firebase.js';
33

44
export const load = (async () => {
5-
const ref = doc(db, 'posts', 'first-post');
5+
const ref = doc(db, 'posts', 'test');
66
const docSnap = await getDoc(ref);
77
const data = docSnap.data();
88
return {

0 commit comments

Comments
 (0)