react-json-viewer-cool
Version:
React json view plugin, supports expansion and hiding. Uses react hooks.
19 lines (16 loc) • 369 B
JavaScript
import React from 'react';
import { needFormat } from './utils.js';
import ComplexTree from './complexTree.js';
import NormalTree from './normalTree.js';
export default function Tree(props) {
let { type } = props;
return (
<>
{needFormat(type) ? (
<ComplexTree {...props} />
) : (
<NormalTree {...props} />
)}
</>
);
}