mirror of
https://github.com/vale981/accounts-ui
synced 2025-03-04 17:31:41 -05:00
check onChange exists before call it
This commit is contained in:
parent
171270376b
commit
12a1ad180a
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ export class Field extends React.Component {
|
|||
triggerUpdate() {
|
||||
// Trigger an onChange on inital load, to support browser prefilled values.
|
||||
const { onChange } = this.props;
|
||||
if (this.input && this.input.value) {
|
||||
if (this.input && this.input.value && onChange) {
|
||||
onChange({ target: { value: this.input.value } });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue