You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2022. It is now read-only.
The handle update function's behavior confuses me a little bit. Looks like the whole data object is deep cloned before setting the new property here.
The documentation in the README shows:
// Update current state with changes from controls
handleUpdate = newData =>
this.setState(prevState => ({
data: { ...prevState.data, ...newData }
}));
which I took to imply that newData would only have the updated values according to the recent event.
The deep cloning has some other downstream issues, such as affecting object equality and causing a lot of unnecessary hooks to fire.
The handle update function's behavior confuses me a little bit. Looks like the whole data object is deep cloned before setting the new property here.
The documentation in the README shows:
which I took to imply that newData would only have the updated values according to the recent event.
The deep cloning has some other downstream issues, such as affecting object equality and causing a lot of unnecessary hooks to fire.
I've made a PR which changes this to instead just populate
newData
with the updated key/value, it works for me locally and fixes a lot of my bugs.https://github.com/claus/react-dat-gui/pull/57/files
The text was updated successfully, but these errors were encountered: