React JS Ignore服务器端呈现

时间:2016-01-10 21:57:09

标签: javascript facebook reactjs

我正在研究" Isomorphic"基于React,Redux,React Router,Nodejs等的Web应用程序......

在我的情况下,我做服务器端渲染,以便让搜索引擎抓取网站和社交网络,以便在共享时读取元标记

我遇到这种情况,当用户登录(个性化)和没有用户登录时(服务器端渲染,无会话),渲染实际上是不同的

问题是,一旦用户登录Web客户端,渲染失败的原因是: Invariant Violation: You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side: (client) operty-fb=2app_id">... (server) operty-fb=2app_id">...

我想我的问题是,有没有办法在某些情况下做出反应,不进行校验和测试并重新渲染整个DOM?

0 个答案:

没有答案