Skip to content

hasChildTextNode doesn’t handle numeric children #21

Open
@ticky

Description

@ticky

The code at assertions.js#L34-L35 doesn’t handle numeric children and throws an uncaught error trying to access properties of the number object in these instances.

This is a seemingly common thing in the wild. Things like react-data-components emit elements whose only children are numbers.

I’m happy to provide a PR, but not sure what the best option is here, but it may be to handle numeric children as strings. That said, this perhaps brings up a question about how “implicit” string conversions should be handled.

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