I have tree list components when I click on any item of the tree list it shows the result of JSON data. I don’t wanna JSON format but parse format.
i have tried let json = JSON.parse(this.props.node, null, 4);
but it showing Unexpected token u in JSON at position 0
You can visit the Link
class NodeViewer extends React.Component {
constructor(props) {
super(props);
}
render() {
const style = styles.viewer;
let json = JSON.stringify(this.props.node, null, 4);
if (!json) {
json = HELP_MSG;
}
return <div style={style.base}>{json}</div>;
}
}
NodeViewer.propTypes = {
node: PropTypes.object
};