Skip to content

Commit 5f46b2c

Browse files
committed
Use watch from useForm instead of useWatch
1 parent 1cb9b73 commit 5f46b2c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

gui/src/components/onboarding/pages/body-proportions/scaled-steps/ManualHeightStep.tsx

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Localized, useLocalization } from '@fluent/react';
55
import { useMemo } from 'react';
66
import { useLocaleConfig } from '@/i18n/config';
77
import { useHeightContext } from '@/hooks/height';
8-
import { useForm, useWatch } from 'react-hook-form';
8+
import { useForm } from 'react-hook-form';
99
import {
1010
ChangeSettingsRequestT,
1111
ModelSettingsT,
@@ -34,17 +34,13 @@ export function ManualHeightStep({
3434
}) {
3535
const { l10n } = useLocalization();
3636
const { hmdHeight, setHmdHeight } = useHeightContext();
37-
const { control, handleSubmit } = useForm<HeightForm>({
37+
const { control, handleSubmit, watch } = useForm<HeightForm>({
3838
defaultValues: { height: 1.5 },
3939
});
4040
const { sendRPCPacket } = useWebsocketAPI();
4141
const { currentLocales } = useLocaleConfig();
4242
const { statuses } = useStatusContext();
43-
const height = useWatch({
44-
name: 'height',
45-
defaultValue: 1.5,
46-
control,
47-
});
43+
const height = watch('height');
4844

4945
const missingSteamConnection = useMemo(
5046
() =>

0 commit comments

Comments
 (0)