Skip to content

How to set global navigator.userAgent in server-side rendering #2356

@adieuadieu

Description

@adieuadieu

The styles/auto-prefix.js auto-prefixer warns that, "Material-UI expects the global navigator.userAgent to be defined for server-side rendering. Set this property when receiving the request headers."

https://github.com/callemall/material-ui/blob/master/src/styles/auto-prefix.js#L10

Anyone have any example of this being implemented, or have suggestions on how to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: GlobalStylesThe React component.scope: stylesSpecific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions