aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/button-group/button-group.component.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/button-group/button-group.component.js')
-rw-r--r--ui/app/components/button-group/button-group.component.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/app/components/button-group/button-group.component.js b/ui/app/components/button-group/button-group.component.js
index 723f9b526..17a281030 100644
--- a/ui/app/components/button-group/button-group.component.js
+++ b/ui/app/components/button-group/button-group.component.js
@@ -10,6 +10,7 @@ export default class ButtonGroup extends PureComponent {
children: PropTypes.array,
className: PropTypes.string,
style: PropTypes.object,
+ newActiveButtonIndex: PropTypes.number,
}
static defaultProps = {
@@ -23,9 +24,10 @@ export default class ButtonGroup extends PureComponent {
: this.props.defaultActiveButtonIndex,
}
- componentDidUpdate (prevProps, prevState) {
+ componentDidUpdate (_, prevState) {
+ // Provides an API for dynamically updating the activeButtonIndex
if (typeof this.props.newActiveButtonIndex === 'number' && prevState.activeButtonIndex !== this.props.newActiveButtonIndex) {
- this.setState({ activeButtonIndex: prevProps.newActiveButtonIndex })
+ this.setState({ activeButtonIndex: this.props.newActiveButtonIndex })
}
}