-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: react hydration errors on admin #398
fix: react hydration errors on admin #398
Conversation
From CodeDay Labs Slack:
|
#398 |
Hi, @Komal914, thanks for taking the initiative on this issue. What is the reasoning behind using // The rest of your code inside of /admin/index.js
export default function Home() {
const AdminTable = dynamic (() => import('path/to/adminTable'), ssr: false,});
// The rest of your code inside of /admin/index.js
return {
// The rest of your return code inside of /admin/index.js
<AdminTable />
// The rest of your return code inside of /admin/index.js
}
} ? Regardless, another change I think that we should do is to deprecate our use of The hope is that we do not find this issue inside of our new table library since the one the admin table is currently using has caused lots of issues for us before. If it does, however, we can attempt this fix that you have. |
I did not realize we can simply import using dynamic with next.js. I will try the import instead and see if this takes care of the errors. Additionally I can update to |
Hey @GuillermoFloresV please take a look at this PR again. I updated the import to use dynamic with no ssr for admintable. As for the table update, I think we should have that a separate issue as it requires me to research and dig into the data. I would be happy to work on it so feel free to assign me as I am experimenting with it already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Komal914 and @theGaryLarson for fixing this hydration error. Turning off server side rendering seems like a reasonable approach.
Checklist:
Update index.md
)Closes #361
Closes #360
Closes #359
This solution turns off server side rendering for the AdminTable component. I do not fully understand the benefits and tradeoffs of turning off server side rendering as I am still researching this topic. Let me know if you prefer server side to be on rather than off for AdminTable.