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 b637bcb commit d3b5646
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions showcase/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,12 @@ export class Main extends React.Component<IProps, IState> {
hint="Must be a file"
labelText="Upload your file"
name="myFileTest"
validators={[isFile()]}
/>
<FileField
ref={myFileRef2}
hint="Must be a file"
labelText="Upload your file"
name="myFileTest"
validators={[isFile()]}
/>

<RadioGroup name="group1">
Expand Down
4 changes: 1 addition & 3 deletions src/core/_MetadataFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ export class MetadataFile<T extends IFieldValidation> extends AbstractMetadata<T
isTouched: true,
},
};
useEffect(() => {
this.updateState(state);
}, [state]);
this.updateState(state);
}
}
}
Expand Down

0 comments on commit d3b5646

Please sign in to comment.