3

I have sample template (react, material-ui, asp core) with server rendering. I've source here https://github.com/Stoope/ASP_CORE_REACT. When I run the app I get warning in f12 tool console

React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server: (client) ng:0px 24px;display:flex;justify-content (server) ng:0px 24px;display:-webkit-box,-moz-box

when i set useAgent: 'all' in Layout.tsx

const muiTheme = getMuiTheme({
  userAgent: 'all',
});

it works without warnings but toolbar layout seems broken

Stopee
  • 267
  • 2
  • 10
  • take a look here and try some of the solutions: https://github.com/callemall/material-ui/issues/4466 – narvoxx Oct 31 '16 at 08:13
  • I can't run request.headers['user-agent'] on server side coz i'm not using NodeJS to handle requests – Stopee Oct 31 '16 at 08:20
  • I haven't read everything in the issue I linked above so I don't know the context exactly, but according to this it's possible to get the user agent headers in asp.net: http://stackoverflow.com/questions/15309304/trying-to-get-the-user-agent-from-request-in-asp-net-web-api-self-host or http://stackoverflow.com/questions/28664770/how-to-get-user-browser-name-user-agent-in-asp-net-core – narvoxx Oct 31 '16 at 08:32
  • But how can I send variable from asp.net to NodeJS? – Stopee Oct 31 '16 at 08:39

0 Answers0