This repository has been archived by the owner on May 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
Objects without prototype chain are broken #20
Comments
martinhoefling
added a commit
to martinhoefling/react-json-tree
that referenced
this issue
Jan 5, 2016
Did you test your solution? I don't think it will work, because
Unfortunately I cannot build the package myself, thus I cannot test changes and I don't want to make a PR. |
Yes, so I changed that line and got the expected behavior (in my case). Edit: actually - I did not copy the line but instead made an edit on github. You're right - obj is not defined. Your suggestion seems to be the proper fix I guess. |
I've pushed #23 and tested this. Works for me. |
Closed #23 thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When objects are created via
Object.create(null)
they cannot be expanded and the object properties are not shown due toUncaught TypeError: obj.hasOwnProperty is not a function
.The problematic part is in https://github.com/chibicode/react-json-tree/blob/master/src/JSONObjectNode.js#L32 where it is assumed that hasOwnProperty is always present.
The text was updated successfully, but these errors were encountered: