mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
fix(devui): Always run updateTabs on UNSAFE_componentWillReceiveProps. Otherwise, the changes in property tabs might not be reflected on the UI.
This commit is contained in:
parent
a094e3b42c
commit
0e366fccc3
|
@ -24,11 +24,9 @@ export default class Tabs<P> extends Component<TabsProps<P>> {
|
|||
SelectedComponent?: React.ComponentType<P>;
|
||||
selector?: () => P;
|
||||
|
||||
UNSAFE_componentWillReceiveProps(nextProps: TabsProps<P>) {
|
||||
if (nextProps.selected !== this.props.selected) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps: TabsProps<P>): void {
|
||||
this.updateTabs(nextProps);
|
||||
}
|
||||
}
|
||||
|
||||
onMouseUp: React.MouseEventHandler<HTMLButtonElement> = (e) => {
|
||||
e.currentTarget.blur();
|
||||
|
@ -38,7 +36,7 @@ export default class Tabs<P> extends Component<TabsProps<P>> {
|
|||
this.props.onClick(e.currentTarget.value);
|
||||
};
|
||||
|
||||
updateTabs(props: TabsProps<P>) {
|
||||
updateTabs(props: TabsProps<P>): void {
|
||||
const tabs = props.tabs;
|
||||
const selected = props.selected;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user