import React , { Component } from 'react' ; import { Editor } from '@redux-devtools/ui' ; import { stringify } from 'javascript-stringify' ; interface Props { data : unknown ; } export default class RawTab extends Component < Props > { value ? : string | undefined ; constructor ( props ) { super ( props ) ; this . stringifyData ( props ) ; } shouldComponentUpdate ( nextProps ) { return nextProps . data !== this . value ; } UNSAFE_componentWillUpdate ( nextProps ) { this . stringifyData ( nextProps ) ; } stringifyData ( props ) { this . value = stringify ( props . data , null , 2 ) ; } render ( ) { return < Editor value = { this . value } />; } }