import React from 'react'; import PropTypes from 'prop-types'; export default class ObjectEditor extends React.Component { static propTypes: any; static defaultProps: any; constructor(props) { super(props); this.state = {value: angular.toJson(props.value || {}, 2)}; this.onChange = this.onChange.bind(this); } onChange(event) { this.setState({value: event.target.value}); try { const parsed = angular.fromJson(event.target.value); this.props.onChange(parsed); } catch (err) { // pass } } render() { const lines = this.state.value.split('\n').length; return (