From 8990f565c771f2b1a5cda1266e5fd7d336a23dce Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 12 Sep 2022 17:08:35 +0300 Subject: [PATCH] Fix bug w/ WeaponCombobox not showing initial val --- app/components/Combobox.tsx | 6 +++++- app/modules/analyzer/useAnalyzeBuild.ts | 11 +++++++---- app/routes/analyzer.tsx | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/components/Combobox.tsx b/app/components/Combobox.tsx index a1b9dc01f..6b537b89e 100644 --- a/app/components/Combobox.tsx +++ b/app/components/Combobox.tsx @@ -208,7 +208,11 @@ export function WeaponCombobox({ (0); + const [weaponId, setWeaponId] = React.useState( + mainWeaponIds[0] + ); const analyzed = React.useMemo( () => buildStats({ build, weaponSplId: weaponId }), diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index 50eee9f70..8f429c9aa 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -30,7 +30,7 @@ export default function BuildAnalyzerPage() {
opt && setWeaponId(Number(opt.value) as MainWeaponId)