import React from 'react'; import './style.css'; import JSONViewer from './Components/JSONViewer'; import Footer from './Components/Footer'; export default function App() { return ( <JSONViewer /> <Footer /> ); }Compiling application & starting dev server…react-json-viewer.stackblitz...
npm install --save react-json-viewer Usage importReact,{Component}from'react';importJSONViewerfrom'react-json-viewer';classExampleextendsComponent{render(){return(<JSONViewerjson={[{task:'Learn React',done:true,},{task:'Write Book',done:false,},]}/>);}} ...
terminal JSON viewer & JSON Parser 2019-12-14 14:30 −# terminal JSON viewer https://github.com/antonmedv/fx Child2.whyDidYouRender=trueconstApp=()=>{const[state,setState]=React.useState({})return(<Child>{JSON.stringify(state,null,2)}</Child><Button type="button"onClick={()=>setState({hello:'hi'})}>Submit</Button><Child2>Child #2</Child2>)}exportdefaultApp 只有这样做...
react-json-tree React JSON Viewer组件,从提取。 支持对象,例如 。 用法 import JSONTree from ' react-json-tree ' // If you're using Immutable.js: `npm i --save immutable` import { Map } from ' immutable ' // Inside a React component: const json = { array : [ 1 , 2 , 3 ], ...