File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,17 @@ export class JsonSchemaViewerComponent extends React.PureComponent<IJsonSchemaVi
7676
7777 @action
7878 public componentDidUpdate ( prevProps : Readonly < IJsonSchemaViewer > ) {
79- if ( this . treeStore . defaultExpandedDepth !== this . expandedDepth ) {
79+ if ( prevProps . resolveRef !== this . props . resolveRef ) {
80+ this . tree . resolveRef = this . props . resolveRef ;
81+ }
82+
83+ if (
84+ this . treeStore . defaultExpandedDepth !== this . expandedDepth ||
85+ prevProps . schema !== this . props . schema ||
86+ prevProps . mergeAllOf !== this . props . mergeAllOf
87+ ) {
8088 this . treeStore . defaultExpandedDepth = this . expandedDepth ;
8189 this . tree . expandedDepth = this . expandedDepth ;
82- this . renderSchema ( ) ;
83- } else if ( prevProps . schema !== this . props . schema || prevProps . mergeAllOf !== this . props . mergeAllOf ) {
8490 this . tree . mergeAllOf = this . mergeAllOf ;
8591 this . tree . schema = this . props . schema ;
8692 this . renderSchema ( ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export { TreeState as SchemaTreeState };
2121export class SchemaTree extends Tree {
2222 public expandedDepth : number ;
2323 public mergeAllOf : boolean ;
24- protected resolveRef : Optional < SchemaTreeRefDereferenceFn > ;
24+ public resolveRef : Optional < SchemaTreeRefDereferenceFn > ;
2525
2626 constructor ( public schema : JSONSchema4 , public state : TreeState , opts : SchemaTreeOptions ) {
2727 super ( ) ;
You can’t perform that action at this time.
0 commit comments