DocumentTitle 中包含多div标签问题

以下是出现错误的信息:Uncaught Invariant Violation: Minified React error #143; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=143 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

查看react官方文档可见:

Error Decoder

In the minified production build of React, we avoid sending down full error messages in order to reduce the number of bytes sent over the wire.

We highly recommend using the development build locally when debugging your app since it tracks additional debug info and provides helpful warnings about potential problems in your apps, but if you encounter an exception while using the production build, this page will reassemble the original text of the error.

The full text of the error you just encountered is:

React.Children.only expected to receive a single React element child.

DocumentTitle 不会被react作为element,故会出现以上错误。

故react中DocumentTitle中不可并行包含多个div标签,当然其它标签也一样。

<DocumentTitle>

    <div>  </div> 

   <div>  </div>

</DocumentTitle>

上述即是一个错误的例子。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容