Skip to content

Use of <div> fails validateDOMNesting check in certain elements #20

@exogen

Description

@exogen

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions