Skip to content

Don't pass mutable keyPath arrays to callback functions while retaining them in our state #53

@Phanabani

Description

@Phanabani

Callback functions like getStyle, readOnly, etc. pass a mutable array keyPath, which is also retained in REJT code. Users can mutate this array and disrupt REJT's internal state. We should clone these data structures before passing them to callbacks.

Options:

I think immer is overkill, and implementing a homemade clone isn't really worth it, so I think lodash is an easy and reliable solution.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions