Skip to content

Commit

Permalink
fix: use getValues instead of watch for default values
Browse files Browse the repository at this point in the history
  • Loading branch information
justynoh committed Feb 14, 2024
1 parent b428061 commit 771d644
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export const RespondentBlock = ({
const {
formState: { errors },
register,
watch,
getValues,
} = formMethods

const selectedWorkflowType = watch('workflow_type')
const defaultWorkflowType = getValues('workflow_type')

const isFirstStep = isFirstStepByStepNumber(stepNumber)

Expand All @@ -55,7 +55,7 @@ export const RespondentBlock = ({
isRequired
isInvalid={!!errors.workflow_type}
>
<Radio.RadioGroup defaultValue={selectedWorkflowType}>
<Radio.RadioGroup defaultValue={defaultWorkflowType}>
<Flex flexDir="row">
<Radio
allowDeselect={false}
Expand Down

0 comments on commit 771d644

Please sign in to comment.