|
@@ -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<JsonViewerProps, JsonViewerState> {
|
|
|
}
|
|
|
|
|
|
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();
|
|
|
}
|