Tôi đang sử dụng React với SSR FlowRouter.Phản hồi SSR - xử lý window.height/width
Vì dòng này:
var height = (Meteor.isClient ? window.innerHeight : 0);
<div style={{top: height+'px' }}>
tôi nhận được một cảnh báo như vậy:
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.
Tôi biết Thats vì sự khác biệt giữa khách hàng và mã máy chủ (Tôi không có quyền truy cập vào cửa sổ trên máy chủ của tôi).
Có cách nào để tránh cảnh báo này không?
Cảm ơn bạn đã đăng, bạn có hiểu điều này không? – Coherent