Skip to content

Documentation: Make it clear when the __key argument should be used and when clone should be called #6937

Open
@etrepum

Description

@etrepum

Description

It's a common mistake for people to assume that they just pass __key around, but the reality is that you should never ever use __key except when implementing a constructor or clone method.

Another common mistake is to assume that clone is something that can be used to duplicate a node. It's not. It should be considered a private method that is only called internally.

There is some relevant documentation about this $cloneWithProperties and various invariants but people keep running into this so we should add more docs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions