react-resize-observer icon indicating copy to clipboard operation
react-resize-observer copied to clipboard

Use of <div> fails validateDOMNesting check in certain elements

Open exogen opened this issue 7 years ago • 0 comments

Apologies if someone has brought this up before. I'm using react-resize-observer in a way where I need it to live inside elements like <p> and <span> sometimes.

But React complains about this since it's against the HTML spec:

index.js:2178 Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.

It seems like the same functionality could be done with span as long as it's set to display: block. AFAIK spans are valid everywhere. Would it be worthwhile to switch?

exogen avatar Oct 06 '18 09:10 exogen