-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloneIfObject
converts arrays to objects
#385
Comments
Maybe |
It seems like what we want for this check is less like |
I would have no problem if the cloning was ditched. It would then just be up to the user to handle immutability themselves when they call If we do keep the cloning, we should deal with the arrays properly, though! |
Released: v2.0.1
|
If you pass an array into this function, it returns an object.
formsy-react/src/utils.ts
Lines 47 to 50 in 6fcc682
This is because this function returns
true
when passed an array:formsy-react/src/utils.ts
Lines 7 to 9 in 6fcc682
(Try in browser console)
I'm not certain if arrays need to be cloned too, but a workaround is:
...but then
cloneIfObject
isn't very well named!The text was updated successfully, but these errors were encountered: