1- /* @jsx jsx */
2-
3- import { jsx } from '@emotion/core' ;
41import { Dictionary , ISchema } from '@stoplight/types' ;
52import { Box , Button , IBox } from '@stoplight/ui-kit' ;
63import dropRight = require( 'lodash/dropRight' ) ;
7- import { FunctionComponent , MouseEventHandler , ReactNodeArray , useCallback , useState } from 'react' ;
4+ import * as React from 'react' ;
85import { MutedText } from './common/MutedText' ;
96import { renderSchema } from './renderers/renderSchema' ;
107import { useTheme } from './theme' ;
@@ -24,7 +21,7 @@ export interface ISchemaViewProps {
2421
2522export interface ISchemaView extends ISchemaViewProps , IBox { }
2623
27- export const SchemaView : FunctionComponent < ISchemaView > = props => {
24+ export const SchemaView : React . FunctionComponent < ISchemaView > = props => {
2825 const {
2926 defaultExpandedDepth = 1 ,
3027 emptyText,
@@ -38,17 +35,17 @@ export const SchemaView: FunctionComponent<ISchemaView> = props => {
3835 } = props ;
3936
4037 const theme = useTheme ( ) ;
41- const [ showExtra , setShowExtra ] = useState < boolean > ( false ) ;
42- const [ expandedRows , setExpandedRows ] = useState < Dictionary < boolean > > ( { all : expanded } ) ;
38+ const [ showExtra , setShowExtra ] = React . useState < boolean > ( false ) ;
39+ const [ expandedRows , setExpandedRows ] = React . useState < Dictionary < boolean > > ( { all : expanded } ) ;
4340
44- const toggleExpandRow = useCallback < ( rowKey : string , expanded : boolean ) => void > (
41+ const toggleExpandRow = React . useCallback < ( rowKey : string , expanded : boolean ) => void > (
4542 ( rowKey , expandRow ) => {
4643 setExpandedRows ( { ...expandedRows , [ rowKey ] : expandRow } ) ;
4744 } ,
4845 [ expandedRows ]
4946 ) ;
5047
51- const toggleShowExtra = useCallback < MouseEventHandler < HTMLElement > > (
48+ const toggleShowExtra = React . useCallback < React . MouseEventHandler < HTMLElement > > (
5249 ( ) => {
5350 setShowExtra ( ! showExtra ) ;
5451 } ,
@@ -73,7 +70,7 @@ export const SchemaView: FunctionComponent<ISchemaView> = props => {
7370 actualSchema = buildAllOfSchema ( schemaProps ) ;
7471 }
7572
76- let rowElems : ReactNodeArray = [ ] ;
73+ let rowElems : React . ReactNodeArray = [ ] ;
7774
7875 renderSchema ( {
7976 schemas,
0 commit comments