MUI with next/image got React Hydration Error
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
I’m started with https://github.com/mui-org/material-ui/tree/master/examples/nextjs-with-typescript and use next/image
import Image from 'next/image';
export default function Logo() {
return <Image src="/logo.png" alt="logo" width={130} height={65} />;
}
then got “Warning: Prop style
did not match” in console.
Expected behavior 🤔
Get rid console error.
Steps to reproduce 🕹
Steps:
- Get start with https://github.com/mui-org/material-ui/tree/master/examples/nextjs-with-typescript
- Create Logo component
- Add to page
Context 🔦
Having error in console.
Your environment 🌎
`npx @mui/envinfo`
System:
OS: Windows 10 10.0.22000
Binaries:
Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: Not Found
Edge: Spartan (44.22000.120.0), Chromium (96.0.1054.62)
npmPackages:
@emotion/react: ^11.7.1 => 11.7.1
@emotion/styled: ^11.6.0 => 11.6.0
@mui/base: 5.0.0-alpha.62
@mui/icons-material: ^5.2.5 => 5.2.5
@mui/material: ^5.2.6 => 5.2.6
@mui/private-theming: 5.2.3
@mui/styled-engine: 5.2.6
@mui/system: 5.2.6
@mui/types: 7.1.0
@mui/utils: 5.2.3
@types/react: 17.0.38 => 17.0.38
react: 17.0.2 => 17.0.2
react-dom: 17.0.2 => 17.0.2
typescript: 4.5.4 => 4.5.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
react-hydration-error - Next.js
In general this issue is caused by using a specific library or application code that is relying on something that could differ between...
Read more >How to solve react hydration error in Nextjs - Stack Overflow
In this example, you will get the React Hydration Error if the <a> tag is used inside another <a> tag.
Read more >MUI with next/image got React Hydration Error #30466 - GitHub
then got "Warning: Prop style did not match" in console. Expected behavior. Get rid console error. Steps to reproduce. Steps:.
Read more >Fix Next.js “Text content does not match server-rendered ...
Learn how to fix the React hydration error “Text content does not match server-rendered HTML” so you can personalize & transform HTML in ......
Read more >How To Solve Hydration Error In Next.js | by Westin Tang
The code in react-dom will use tryHydrate to try the hydrate operation, if it fails, the mode and flags will be checked and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s Dark Reader (Browser’s Extension) fault.
Now the issues is gone with nothing fix. Sorry for wasting your time.