Skip to content

Commit

Permalink
Use static initializer in ValidatedDualRange for storybook compat
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar committed Mar 19, 2020
1 parent 2eda06e commit cd410a9
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 cd410a9

Please sign in to comment.