Comments (5)
In my case, when I visited the route localhost:3000/booking
for the first time, there was no error in the console( which also tricked me closing the issue ), but after that, when I started refreshing the page, the issue came up and stayed there. So I reopened the issue and wonder if there is a solution to fix it or maybe some hacky way so that I could just bypass this issue. Thanks in advance
from mui-x.
@michelengelen Thank you for your prompt reply, Sir! And by following your advice, I tested it out in Firefox, and this time there was no issue as expected, and also more weirder thing is when I switched back to the google chrome and gave it try again, the issue was not there anymore whether I turned on/off those plugins, just like what happened yesterday.
It seems this is some issue that could occur intermittently while we develop our projects as developers. So for that, please allow me to share some workarounds I found, hopefully it could help someone else who may get stuck with this sort of hydration issue during development at some point in the future:
'use client'
import React, { useState } from 'react'
import { LocalizationProvider } from '@mui/x-date-pickers';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
// import TestCalendar from '@/components/TestCalendar';
import dynamic from 'next/dynamic';
const ClientCalendar1 = dynamic(() => import('@/components/TestCalendar'), { ssr: false })
const ClientCalendar2 = dynamic(() => import('@/components/TestCalendar'))
export default function Booking() {
const [show, setShow] = useState(false)
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
{/* only load at the client side */}
<ClientCalendar1 />
{/* load conditionally */}
{show && <ClientCalendar2 />}
<button onClick={() => setShow(!show)}>toggle</button>
{/* <TestCalendar /> */}
</LocalizationProvider>
)
}
These workaround are Nextjs way to handle SSR, which basically help us skip SSR, so that it is ensured that we are 100% safe to use or test our components no matter what.
Okay, thanks again Sir! And my apology for any trouble caused by this wrong alarm. So I will close this issue now
from mui-x.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
@MyNameIsTakenOMG: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
from mui-x.
Hey @MyNameIsTakenOMG I cannot reproduce this issue.
But I can see that you have some plugins installed, right?
This can sometimes lead to weird next js bugs and should disappear when in production.
Try opening the page in a different browser or in privacy mode.
from mui-x.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
@MyNameIsTakenOMG: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
from mui-x.
Related Issues (20)
- [data grid] Valueparser not called when clearing cell HOT 2
- [charts] `onMarkClick` not working HOT 5
- [question] Can you help me adding code for the ticket https://github.com/mui/mui-x/issues/13298 HOT 2
- [data grid] Shift + Arrow Keys Not Selecting Correct Rows After Independent Row Selection HOT 2
- [charts][docs] The AxisConfig API page is wrong
- [data grid] Can't scroll to end of dataset fast with paginationModel='server' HOT 5
- [data grid] re-rendering / resetting filter on state change HOT 9
- [data grid] How to get the total row count including children rows HOT 5
- [data grid] Page row count to be set on child rows when row grouping is applied HOT 2
- & .MuiDataGrid-columnHeaders is not working with @mui/x-data-grid-pro": ^7.1.1 HOT 1
- [charts] How to add min and max scaling on axis for bar charts to remove decimal scale values HOT 3
- [data grid] changing data is slow HOT 2
- [question] How can i remove column sorting from datagridView ? (^6.19.6)
- MUI Datagrid sortComparator function signature is not available when using typescript
- [data grid] Row spanning with tree/grouping behavior HOT 1
- [charts] Pie chart overflow with legend HOT 5
- [data grid]: there is an issue with the design on the right side when dragging
- [data grid] When used Styled Datagrid, processRowUpdate does not fired.
- [charts] types not exported from ChartsTooltipTable HOT 7
- Leap year data grid date column filter cant be filled from left to right HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mui-x.