Skip to content

Commit 37e1a57

Browse files
Fix Typo
1 parent deb951b commit 37e1a57

File tree

1 file changed

+2
-3
lines changed
  • src/pages/2023-11/react-server-components

1 file changed

+2
-3
lines changed

src/pages/2023-11/react-server-components/index.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The big thing that makes server component different than client components is th
2020
function ClientComponent() {
2121
const [data, setData] = useState(null)
2222
const [loading, setLoading] = useState(true)
23-
const [errr, setError] = useState(false)
23+
const [error, setError] = useState(false)
2424

2525
useEffect(() => {
2626
setLoading(true)
@@ -48,11 +48,10 @@ function ClientComponent() {
4848
async function ServerComponent() {
4949
try {
5050
const data = await fetch("/api/data").then(res => res.json())
51+
return <p>{data}</p>
5152
} catch (error) {
5253
return <p>Error</p>
5354
}
54-
55-
return <p>{data}</p>
5655
}
5756
```
5857

0 commit comments

Comments
 (0)