鍍金池/ 問答/HTML/ react頁面的控制臺提示這個(gè)錯(cuò)誤是怎么回事?

react頁面的控制臺提示這個(gè)錯(cuò)誤是怎么回事?

控制臺:

**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) xxx.com/tfs/TB174YQeMDD8KJjy0FdXXcj
 (server) xxx.com/TB12hfKeLDH8KJjy1XcXXcp
warning @ index.js:8**
回答
編輯回答
憶往昔

做了服務(wù)端渲染吧,這是一個(gè)警告,大意是說你的客戶端的渲染和服務(wù)端的渲染輸出的組件的checksum這個(gè)東西輸出不一致,應(yīng)該是你渲染的組件在第一次render前做了什么操作

2017年10月19日 14:51