250x250
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- Ethereum
- Props
- web
- CSS
- API
- hardhat
- useState
- Interface
- node.js
- express.js
- Redux
- graphQL
- concept
- 기준
- JavaScript
- HTML
- 삶
- tailwindcss
- typeScript
- blockchain
- error
- CLASS
- built in object
- nextJS
- solidity
- middleware
- REACT
- evm
- bitcoin
- SSR
Archives
- Today
- Total
ReasonJun
Next.js Error : Hydration failed because the initail UI does not match what was rendered on the server. 본문
Frontend/Next.js
Next.js Error : Hydration failed because the initail UI does not match what was rendered on the server.
ReasonJun 2023. 11. 23. 11:19728x90
Error :

Why :
While rendering your application, there was a difference between the React tree that was pre-rendered from the server and the React tree that was rendered during the first render in the browser (hydration).
Solution :
import { useState, useEffect } from 'react'
export default function App() {
const [isClient, setIsClient] = useState(false)
useEffect(() => {
setIsClient(true)
}, [])
return <h1>{isClient ? 'This is never prerendered' : 'Prerendered'}</h1>
}
https://nextjs.org/docs/messages/react-hydration-error
Text content does not match server-rendered HTML
Using App Router Features available in /app
nextjs.org
728x90
'Frontend > Next.js' 카테고리의 다른 글
Comments