@@ -7,8 +7,10 @@ import { useConfirm } from '../../layout'
77import { QuestionsConfirmation } from './Confirmation'
88import { ElectionStateStorage , RenderWith , SubElectionState , SubmitFormValidation } from './Questions'
99
10+ export type FormFieldValues = Record < string , FieldValues >
11+
1012export type QuestionsFormContextState = {
11- fmethods : UseFormReturn < any >
13+ fmethods : UseFormReturn < FormFieldValues >
1214} & SpecificFormProviderProps &
1315 ReturnType < typeof useMultiElectionsProvider >
1416
@@ -35,7 +37,7 @@ export type SpecificFormProviderProps = {
3537export const QuestionsFormProvider : React . FC <
3638 PropsWithChildren < QuestionsFormProviderProps & SpecificFormProviderProps >
3739> = ( { children, ...props } ) => {
38- const fmethods = useForm ( )
40+ const fmethods = useForm < FormFieldValues > ( )
3941 const multiElections = useMultiElectionsProvider ( { fmethods, ...props } )
4042
4143 return (
@@ -85,7 +87,7 @@ export const constructVoteBallot = (election: PublishedElection, choices: FieldV
8587const useMultiElectionsProvider = ( {
8688 fmethods,
8789 confirmContents,
88- } : { fmethods : UseFormReturn } & QuestionsFormProviderProps ) => {
90+ } : { fmethods : UseFormReturn < FormFieldValues > } & QuestionsFormProviderProps ) => {
8991 const { confirm } = useConfirm ( )
9092 const { client, isAbleToVote : rootIsAbleToVote , voted : rootVoted , election, vote } = useElection ( ) // Root Election
9193 // State to store on memory the loaded elections to pass it into confirm modal to show the info
0 commit comments