Skip to content

Commit

Permalink
Use static initializer in ValidatedDualRange for storybook com… (#60601)
Browse files Browse the repository at this point in the history
Closes #60356.
  • Loading branch information
dgieselaar authored Mar 19, 2020
1 parent 431b06f commit 915b784
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ interface State {
}

export class ValidatedDualRange extends Component<Props> {
static defaultProps: { fullWidth: boolean; allowEmptyRange: boolean; compressed: boolean };
static defaultProps: { fullWidth: boolean; allowEmptyRange: boolean; compressed: boolean } = {
allowEmptyRange: true,
fullWidth: false,
compressed: false,
};

static getDerivedStateFromProps(nextProps: Props, prevState: State) {
if (nextProps.value !== prevState.prevValue) {
Expand Down Expand Up @@ -125,9 +129,3 @@ export class ValidatedDualRange extends Component<Props> {
);
}
}

ValidatedDualRange.defaultProps = {
allowEmptyRange: true,
fullWidth: false,
compressed: false,
};

0 comments on commit 915b784

Please sign in to comment.