Skip to content

React.cloneElement docs are a bit light #6942

Closed
@glenjamin

Description

@glenjamin

The old cloneWithProps has a nice example, but mentions that it's deprecated in favour of React.cloneElement - https://facebook.github.io/react/docs/clone-with-props.html

Meanwhile https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement is pretty terse, and links to a blog post from 0.13rc2 which has a decent example.

I'm proposing adding a guide page about "modifying" child properties which has a very similar example to the old cloneWithProps page, and then linking to it from there and the cloneElement API docs.

Seem reasonable? I can put together a PR if so.

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