Skip to content

Cannot use div in Tile's content #393

@benjlevesque

Description

@benjlevesque

When using the Tile component, it's not possible to use a <div> in the detail field.

We get a React warning

In HTML, <div> cannot be a descendant of <p>.This will cause a hydration error.

and indeed, an error during hydration (using Next fyi) :

Unhandled Runtime Error

Error: Hydration failed because the initial UI does not match what was rendered on the server.
See more info here: https://nextjs.org/docs/messages/react-hydration-error

Reproduction code :

 <Tile title="Title" desc="Description" detail={<div>something custom</div>} />

This seems like a very simple fix, replacing <p> with <div> renders the same thing, and fixes the issue.
I suggest also fixing desc to use a div as well.

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