From 47548905ce1b20035ffa467391f06280b6fbfcb4 Mon Sep 17 00:00:00 2001 From: derek Date: Mon, 13 Jul 2020 00:19:34 -0400 Subject: ui.components: fix selector components to work with browser buttons Use getDerivedState to set state and only send back props --- ui/src/components/listing-type-select.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'ui/src/components/listing-type-select.tsx') diff --git a/ui/src/components/listing-type-select.tsx b/ui/src/components/listing-type-select.tsx index d583b93c..6d13f19a 100644 --- a/ui/src/components/listing-type-select.tsx +++ b/ui/src/components/listing-type-select.tsx @@ -26,6 +26,12 @@ export class ListingTypeSelect extends Component< this.state = this.emptyState; } + static getDerivedStateFromProps(props) { + return { + type_: props.type_, + }; + } + render() { return (
@@ -45,8 +51,9 @@ export class ListingTypeSelect extends Component< {i18n.t('subscribed')}