Skip to content

Commit 421ec6b

Browse files
committed
fix: isHydrated error
1 parent ce3a499 commit 421ec6b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pages/license-filter.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,14 @@ const LicenseTool: FC = observer(() => {
3434
const [filterOption, setFilterOption] = useState({});
3535
const [disableChoose, setDisableChoose] = useState(false);
3636
const [lists, setLists] = useState<List[]>([]);
37+
const [isHydrated, setIsHydrated] = useState(false);
3738

3839
const now = Math.ceil(100 / choiceSteps.length);
3940

41+
useEffect(() => {
42+
setIsHydrated(true);
43+
}, []);
44+
4045
useEffect(() => {
4146
if (stepIndex === choiceSteps.length) setDisableChoose(true);
4247
}, [stepIndex]);
@@ -94,7 +99,7 @@ const LicenseTool: FC = observer(() => {
9499
className="mb-3"
95100
variant="info"
96101
now={(keyIndex + 1) * now}
97-
label={t('step_x', { step: keyIndex + 1 })}
102+
label={isHydrated ? t('step_x', { step: keyIndex + 1 }) : undefined}
98103
/>
99104
<Button className="mb-2" variant="warning" onClick={backToLast}>
100105
{t('last_step')}

0 commit comments

Comments
 (0)