Skip to content
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

Using Material-UI v4's Hidden components breaks client-side render #45

Closed
twhitson opened this issue Jul 12, 2021 · 1 comment
Closed

Comments

@twhitson
Copy link

Using the Hidden component for responsive rendering seems to work server-side but completely breaks the client-side hydration.
https://material-ui.com/api/hidden/

Uncaught (in promise) Error: HiddenJs(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.

The above error occurred in the <HiddenJs> component:
HiddenJs@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:9011:19
WithWidth@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:8961:26
Hidden@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:9146:31
div
Grid2@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:8416:29
WithStyles2@http://localhost:3000/node_modules/.vite/chunk-4I5GE5QD.js?v=8348f43e:5767:29
div
Grid2@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:8416:29
WithStyles2@http://localhost:3000/node_modules/.vite/chunk-4I5GE5QD.js?v=8348f43e:5767:29
div
Container2@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:5251:17
WithStyles2@http://localhost:3000/node_modules/.vite/chunk-4I5GE5QD.js?v=8348f43e:5767:29
DesktopNavbar2@http://localhost:3000/node_modules/.vite/@mythicalgames_blankos-ui.js?v=8348f43e:1886:23
HiddenJs@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:9011:19
WithWidth@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:8961:26
Hidden@http://localhost:3000/node_modules/.vite/chunk-M6O6TB7Y.js?v=8348f43e:9146:31
menu
StyledComponent2@http://localhost:3000/node_modules/.vite/chunk-4I5GE5QD.js?v=8348f43e:5666:22
HeaderNavigation2@http://localhost:3000/node_modules/.vite/@mythicalgames_blankos-ui.js?v=8348f43e:1929:17
Header
div
StyledComponent2@http://localhost:3000/node_modules/.vite/chunk-4I5GE5QD.js?v=8348f43e:5666:22
Layout@http://localhost:3000/src/components/layout/Layout.tsx?t=1626122462887:34:16
ThemeProvider@http://localhost:3000/node_modules/.vite/chunk-4I5GE5QD.js?v=8348f43e:5124:18
MythicalThemeProvider2@http://localhost:3000/node_modules/.vite/@mythicalgames_blankos-ui.js?v=8348f43e:1477:18
App@http://localhost:3000/src/App.tsx?t=1626122462887:25:13
Suspense
Router2@http://localhost:3000/node_modules/.vite/chunk-DUYGPITX.js?v=8348f43e:1449:30
BrowserRouter2@http://localhost:3000/node_modules/.vite/chunk-DUYGPITX.js?v=8348f43e:1988:35
r2@http://localhost:3000/node_modules/.vite/chunk-R2XQJXG7.js?v=8348f43e:354:21

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
@twhitson
Copy link
Author

Invalid. I wasn't passing children to the Hidden component so of course it was trying to render null. My misuse of the component, not a Vitedge issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant