Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
fix: TypeError: Cannot set property 'value' of null with react-test-r…
Browse files Browse the repository at this point in the history
…enderer (#19)
  • Loading branch information
Baael authored Oct 16, 2020
1 parent ffad133 commit cf913de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/MaskedInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class MaskedInput extends Component<MaskedInputProps> {
} else if (this.props.mask !== nextProps.mask) {
this.mask.setPattern(nextProps.mask, { value: this.mask.getRawValue() });
}

if (this.props.value !== nextProps.value) {
this.mask.setValue(nextProps.value);
this.setInputValue(this._getDisplayValue());
Expand Down Expand Up @@ -243,7 +243,7 @@ export default class MaskedInput extends Component<MaskedInputProps> {

_lastValue = null as any;
setInputValue = (value: string) => {
if (!this._Input) return;
if (!this._Input || !this._Input.input) return;
if (value === this._lastValue) return;

this._lastValue = value;
Expand Down

0 comments on commit cf913de

Please sign in to comment.