【发布时间】:2015-09-03 14:07:26
【问题描述】:
更多关于文档的问题,因为 React 没有记录这种行为。
ReactJS 抛出错误,在 ComponentDidMount() 之前停止 JS 的执行:
Invariant Violation: findComponentRoot ...
这是由于呈现服务器端和客户端之间的内容不同的元素引起的。 这可能是由来自 Google Recaptcha 的以下 sn-p 引起的,其中 iFrame 的内容会更改每个请求:
var MyForm = React.createClass({
...
render: function() {
return (
<iframe src="https://www.google.com/recaptcha/api/fallback?k=SECRETKEY"
frameBorder="0" scrolling="no"
style={{width: "302px", height: "422px", borderStyle: "none"}} >
</iframe>
...
【问题讨论】: