Skip to content

Commit

Permalink
Rollback change to state init. Initializing state to null actually tr…
Browse files Browse the repository at this point in the history
…iggers a react browser warning and complicates using 'prevState' in getDerivedStateFromProps
  • Loading branch information
Aaron Caldwell committed Mar 16, 2020
1 parent 85b1887 commit 2e92b23
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export class ValidatedDualRange extends Component<Props> {
return null;
}

state!: State;
// @ts-ignore state populated by getDerivedStateFromProps
state: State = {};

_onChange = (value: Value) => {
const { isValid, errorMessage } = isRangeValid(
Expand Down

0 comments on commit 2e92b23

Please sign in to comment.