Skip to content

Commit

Permalink
select variant without useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Jan 14, 2025
1 parent a9d4376 commit 811cf92
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ function CommitNonModal({
const [selectedVariant, setSelectedVariant] = useState<VariantV1 | undefined>(
defaultVariant
);
useEffect(() => {
if (defaultVariant) {
setSelectedVariant(defaultVariant);
}
}, [defaultVariant]);

if (defaultVariant && defaultVariant !== selectedVariant) {
setSelectedVariant(defaultVariant);
}

const [{ currentStep }, setStep] = useState<{
previousStep: CommitStep[];
Expand Down

0 comments on commit 811cf92

Please sign in to comment.