import React, { Component } from "react"
import PropTypes from "prop-types"
import ReactJson from 'react-json-view'

export default class JSONFold extends Component {
  render() {
    let { value } = this.props
    const data = JSON.parse(value);
    return <ReactJson src={data} theme="monokai" name={false} />
  }
}

JSONFold.propTypes = {
  value: PropTypes.string.isRequired
}
@@ -160,16 +160,71 @@
 onent %7B%0A
+%0A  initializeComponent = (c) =%3E %7B%0A    this.el = c%0A  %7D%0A%0A
   render
@@ -243,16 +243,27 @@
  %7B value
+, className
  %7D = thi
@@ -279,102 +279,329 @@
    c
-onst data = JSON.parse(value);%0A    return %3CReactJson src=%7Bdata%7D theme=%22monokai%22 name=%7Bfalse%7D /
+lassName = className %7C%7C %22%22%0A    let data = null;  %0A    try %7B%0A      data = JSON.parse(value);%0A    %7D catch(e) %7B%0A      data = null;%0A    %7D%0A    if (data) %7B%0A      return %3CReactJson src=%7Bdata%7D theme=%22monokai%22 name=%7Bfalse%7D /%3E%0A    %7D%0A%0A    return %3Cpre ref=%7Bthis.initializeComponent%7D className=%7BclassName + %22 microlight%22%7D%3E%7Bvalue%7D%3C/pre
 %3E%0A  
@@ -664,10 +664,41 @@
 Required
+,%0A  className: PropTypes.string
 %0A%7D

Fix for no json