-
Notifications
You must be signed in to change notification settings - Fork 67
Expanding Depth #5
Comments
Could you please provide some background for reproducing the case? I tried to supply nested JSON to the example app and expansion worked, screenshot. |
If that's the case it is most likely an issue on my end. I will contact you if I can get more information on the issue. |
I'm sorry for the delay. I've created an example that show the behavior I was trying to describe as well as some other strange behavior. It seems like if I try to change the data for the Inspector (by creating a new inspector) currently opened leaves will not update. If you reopen the leaf after updating the data then the data will update and if you open any children then the children will be updated. var React = require('react');
var Inspector = require('react-json-inspector');
var data1 = { name: "name", description: "info", year: 2015, object: {data: 'some data', embeddedObject: {details: "some details"}} };
var data2 = { name: "another name", description: "more info", year: 2016, object: {data: 'some more data', embeddedObject: {details: "more details"}} };
var inspector1 = <Inspector data={ data1 } />;
var inspector2 = <Inspector data={ data2 } />;
var Wrapper = React.createClass({
getInitialState: function() {
return {
switch: 0
};
},
toggleSwitch: function () {
this.setState({switch: !this.state.switch});
},
render: function () {
if(this.state.switch){
return <div><button onClick={this.toggleSwitch}>Toggle Data</button>{inspector1}</div>;
}else{
return <div><button onClick={this.toggleSwitch}>Toggle Data</button>{inspector2}</div>;
}
}
});
React.render(<Wrapper />,document.getElementById('inspector')); Thank you again for your work on this! |
Thank you, the problem was that I have chosen incorrect |
Thanks for making this! It's been a great help in my chrome extension development.
Version 4.3.0 does not allow for deep expansion of JSON trees. Version 4.2.2 was not affected by this issue.
The text was updated successfully, but these errors were encountered: