Skip to content

Commit

Permalink
Multiple FileRef calls creates infinite loop error Fixes #96
Browse files Browse the repository at this point in the history
  • Loading branch information
joegasewicz committed Jan 20, 2021
1 parent 0186973 commit 6476386
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/_MetadataFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class MetadataFile<T extends IFieldValidation> extends AbstractMetadata<T
}

public update(value: any, validation: Array<IValidation>): void {
let state: {[k: string]: IFieldValidation};
let state: {[k: string]: IFieldValidation} = this.state;
if(!(this.name in this.state)){
state = {
...this.state,
Expand Down Expand Up @@ -54,10 +54,8 @@ export class MetadataFile<T extends IFieldValidation> extends AbstractMetadata<T
isTouched: true,
},
};
useEffect(() => {
this.updateState(state);
}, [state]);
}
this.updateState(state);
}
}
}

0 comments on commit 6476386

Please sign in to comment.