Skip to content

Consider using .valueOf() before providing fragment warning. #4769

@rhys-vdw

Description

@rhys-vdw

We updated and started getting this warning everywhere:

Warning: Any use of a keyed object should be wrapped in React.addons.createFragment(object) before being passed as a child.

Took me a while to realize that it was because we were using Number instances in our jsx.

I wonder if it would be acceptable to apply .valueOf() first (if present) to legalize this situation?

// Obviously we're not literally doing this:
<span>{new Number(5)}</span>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions