Skip to content

Commit 8c2e25e

Browse files
committed
chore: rename Schema.tsx to SchemaView.tsx
1 parent 9a76474 commit 8c2e25e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/JsonSchemaViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Omit } from '@stoplight/types';
55
import { Component } from 'react';
66
import { ErrorMessage } from './common/ErrorMessage';
77
import { MutedText } from './common/MutedText';
8-
import { ISchemaView, SchemaView } from './Schema';
8+
import { ISchemaView, SchemaView } from './SchemaView';
99
import { ThemeZone } from './theme';
1010
import { isSchemaViewerEmpty } from './util/isSchemaViewerEmpty';
1111

src/Schema.tsx renamed to src/SchemaView.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ export const SchemaView: FunctionComponent<ISchemaView> = props => {
4545
const [showExtra, setShowExtra] = useState<boolean>(false);
4646
const [expandedRows, setExpandedRows] = useState<Dictionary<boolean>>({ all: expanded });
4747

48-
const toggleExpandRow = useCallback<(rowKey: string, expanded: boolean) => void>((rowKey, expandRow) => {
49-
setExpandedRows({ ...expandedRows, [rowKey]: expandRow });
50-
}, []);
48+
const toggleExpandRow = useCallback<(rowKey: string, expanded: boolean) => void>(
49+
(rowKey, expandRow) => {
50+
setExpandedRows({ ...expandedRows, [rowKey]: expandRow });
51+
},
52+
[expandedRows]
53+
);
5154

5255
const toggleShowExtra = useCallback<MouseEventHandler<HTMLElement>>(
5356
() => {

0 commit comments

Comments
 (0)