From 278ebeb5737af08e0f203fbc03052bd55e8f169f Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Wed, 29 Dec 2021 12:02:36 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B1=D0=B0=D0=B3=20=D1=81=20=D0=BD=D0=B5=D0=B8?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC=20=D0=B7?= =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20WellTreeSelector?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=20=D0=BF=D0=BE=20=D1=81=D1=82=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=86=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/WellTreeSelector.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/WellTreeSelector.tsx b/src/components/WellTreeSelector.tsx index c741b21..3f8a7c4 100644 --- a/src/components/WellTreeSelector.tsx +++ b/src/components/WellTreeSelector.tsx @@ -61,7 +61,6 @@ export const WellTreeSelector = () => { const history = useHistory() const routeMatch = useRouteMatch('/:route/:id') - /* eslint-disable react-hooks/exhaustive-deps */ useEffect(() => { invokeWebApiWrapperAsync( async () => { @@ -87,13 +86,16 @@ export const WellTreeSelector = () => { })), })) setWellsTree(wellsTree) - setValue(getLabel(wellsTree, routeMatch?.url)) }, setShowLoader, `Не удалось загрузить список скважин` ) }, []) + useEffect(() => { + setValue(getLabel(wellsTree, routeMatch?.url)) + }, [wellsTree, routeMatch]) + const onChange = (value: string): void => { if (wellsTree) setValue(getLabel(wellsTree, value))