diff --git a/packages/semi-ui/jsonViewer/index.tsx b/packages/semi-ui/jsonViewer/index.tsx index 69baec8775..5fad1178aa 100644 --- a/packages/semi-ui/jsonViewer/index.tsx +++ b/packages/semi-ui/jsonViewer/index.tsx @@ -20,6 +20,7 @@ import { IconWholeWord, } from '@douyinfe/semi-icons'; import BaseComponent, { BaseProps } from '../_base/baseComponent'; +import {isEqual} from "lodash"; const prefixCls = cssClasses.PREFIX; export type { JsonViewerOptions }; @@ -81,7 +82,7 @@ class JsonViewerCom extends BaseComponent { } componentDidUpdate(prevProps: JsonViewerProps): void { - if (prevProps.options !== this.props.options) { + if (!isEqual(prevProps.options, this.props.options) || this.props.value !== prevProps.value) { this.foundation.jsonViewer.dispose(); this.foundation.init(); }