2017年1月17日 星期二

噴錯解法 figure out why the markup being generated is different on the client or server:

Warning: 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) id="1">
{

     (global as any).navigator.userAgent = req.headers['user-agent'] || 'all';
     (global as any).navigator =  (global as any).navigator || {};
 ..
}