Skip to content

Commit bbe6da4

Browse files
committed
Review changes
1 parent 1d90f8e commit bbe6da4

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/components/core/filters/filter-group.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type State = {
1313

1414
export default class FilterGroup extends Component {
1515
props: FilterGroupProps;
16-
state: State = { expanded: false };
16+
state: State = { expanded: this.props.initiallyExpanded };
1717

1818
selectedCount = () => {
1919
const { values = [] } = this.props;
@@ -23,10 +23,6 @@ export default class FilterGroup extends Component {
2323
}, 0);
2424
};
2525

26-
getExpandedState = () => {
27-
return this.props.initialyExpanded ? !this.state.expanded : this.state.expanded;
28-
}
29-
3026
toggleExpansion = () => this.setState({ expanded: !this.state.expanded });
3127

3228
render() {
@@ -35,7 +31,7 @@ export default class FilterGroup extends Component {
3531
onClearFacet = () => {},
3632
onSelectFacet = () => {},
3733
} = this.props;
38-
const expanded = this.getExpandedState();
34+
const { expanded } = this.state;
3935

4036
const updatedChildren = React.Children.map(children, (child) => {
4137
return React.cloneElement(child, { onSelectFacet, term, values });

0 commit comments

Comments
 (0)