Skip to content

ReactTextComponent's string props clashes with cloneWithProps #1962

@glenjamin

Description

@glenjamin

The effect of this can be seen in this gist which uses react-bootstrap: http://jsfiddle.net/Hhc8z/1/

Relevant excerpts from the source:
https://github.com/react-bootstrap/react-bootstrap/blob/master/src/Navbar.jsx#L80
https://github.com/react-bootstrap/react-bootstrap/blob/master/src/utils/ValidComponentChildren.js#L19
https://github.com/react-bootstrap/react-bootstrap/blob/master/src/utils/cloneWithProps.js#L149

I'm trying to fix this in the boostrap lib, but it does seem like a bit of a gotcha anyway.

Is there a documented way to decide if cloneWithProps is safe to do, or is this supposed to just work in the current descriptor scheme of things?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions