Skip to content

Using rendered HTML as error or help text causes validationDOMNesting warnings #4031

@heath-freenome

Description

@heath-freenome

Prerequisites

What theme are you using?

mui

Version

5.x

Current Behavior

I am rendering complex HTML as my errors, with hidden divs or paragraphs and other html content that is not valid inside of a <p> tag. Since the default render tag for FormHelperText is a <p> the browser console has a bunch of warnings like:

Warning: validateDOMNesting(...): <p> cannot appear as a descendant of <p>
...

or

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

Expected Behavior

The FieldHelperTemplate or FieldErrorTemplate for @rjsf/mui do not exhibit these warnings

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmaterial-uimaterial-ui related theme issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions