Skip to content

Instantly share code, notes, and snippets.

@ThaddeusJiang
Created August 13, 2018 04:28
Show Gist options
  • Save ThaddeusJiang/993f76445a9e7f1dc0917ee04579cfc9 to your computer and use it in GitHub Desktop.
Save ThaddeusJiang/993f76445a9e7f1dc0917ee04579cfc9 to your computer and use it in GitHub Desktop.
Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.

当使用范围小的标签包裹范围大的标签的时候,会出现👆问题。 如:

<p>
  <div> p 承受不起 div <div>
</p>

解决方法: 使用范围更大的标签,如:

<div>
  <div> p 不行, div 可以 <div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment