I get this warning:
Material-UI: userAgent should be supplied in the muiTheme context for server-side rendering
with the following server-side rendering setting, which I am doing wrong:
match({routes: R(), location}, (error, redirectLocation, renderProps) => { if (error) { console.error("error: "+ error) } else if (redirectLocation) { console.error("redirect to " + redirectLocation) } else if (renderProps) { const theme = getMuiTheme({userAgent: "all"}) page = ReactDOMServer.renderToStaticMarkup( <MuiThemeProvider muiTheme={theme}> <Provider store={store}> <RouterContext {...renderProps} /> </Provider> </MuiThemeProvider> ) } else { console.error("location nof found: '"+ location +"'") } })
reactjs react-router material-ui
Max L.
source share