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

[docs] ssrMatchMedia required for client rending as well #18680

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

moshest
Copy link
Contributor

@moshest moshest commented Dec 4, 2019

Closes #18678

@mui-pr-bot
Copy link

No bundle size changes comparing b14c7a4...c20d8a7

Generated by 🚫 dangerJS against c20d8a7

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Dec 4, 2019
@eps1lon
Copy link
Member

eps1lon commented Dec 4, 2019

@moshest Much appreciated, thanks!

@moshest moshest deleted the patch-1 branch December 4, 2019 17:32
@mattsrobot
Copy link

mattsrobot commented Dec 8, 2019

@oliviertassinari I am using SSR with useMediaQuery() I'm seeing a bug with rendering on mobile, the desktop layout is briefly shown before.

From what I understand, there are some props needed for mediaQuery? I am not sure what ssrMatchMedia is meant to do here :(

const theme = createMuiTheme({
    props: {
        MuiUseMediaQuery: { ssrMatchMedia }
    }

@moshest
Copy link
Contributor Author

moshest commented Dec 8, 2019

@mattsrobot Please check issue #18678

You need to provide the ssrMatchMedia on client as well to the server.

@mattsrobot
Copy link

@moshest ahh thankyou, yes #18678 helps!

Looks like the answer is contained here. Cheers.

https://material-ui.com/components/use-media-query/#server-side-rendering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation hook: useMediaQuery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] ssrMatchMedia option for useMediaQuery required for client rending as well
5 participants