TayyabCodes
TayyabCodes
TTCTheo's Typesafe Cult
Created by TayyabCodes on 12/22/2023 in #questions
Problem with react-hook-form
Thanks in advance
22 replies
TTCTheo's Typesafe Cult
Created by TayyabCodes on 12/22/2023 in #questions
Problem with react-hook-form
my laptop is dead so please answer i will see it and then when i will come back i will answer back
22 replies
TTCTheo's Typesafe Cult
Created by TayyabCodes on 12/22/2023 in #questions
Problem with react-hook-form
what else you need please tell?
22 replies
TTCTheo's Typesafe Cult
Created by TayyabCodes on 12/22/2023 in #questions
Problem with react-hook-form
here is the form:
<FormProvider {...methods}>
<form onSubmit={handleSubmit(onSubmit)}>
<LoadingOverlay
visible={loading}
zIndex={1000}
overlayProps={{ radius: "sm", blur: 2 }}
/>
<Group justify="space-between">
<Title order={2}>Send a Message</Title>
<Controller
name="channel"
control={control}
render={({ field }) => (
<Select
variant="filled"
checkIconPosition="right"
placeholder="Select Channel"
data={chName}
searchable
nothingFoundMessage="No Channel Found"
error={errors && errors.channel?.message}
{...field}
/>
)}
/>
</Group>
<Textarea
className="my-3"
variant="filled"
label="Message"
withAsterisk
description="What you want to send to the Discord?"
placeholder="Hello, This is a message sent from Test Bot Dashboard Website"
autosize
minRows={5}
error={errors && errors.content?.message}
{...register("content")}
/>
<EmbedBuilder
register={register}
errors={errors}
setValue={setValue}
control={control}
isSubmitSuccessful={isSubmitSuccessful}
watch={watch}
/>
<Button type="submit" disabled={isSubmitting}>
Send
</Button>
</form>
</FormProvider>
<FormProvider {...methods}>
<form onSubmit={handleSubmit(onSubmit)}>
<LoadingOverlay
visible={loading}
zIndex={1000}
overlayProps={{ radius: "sm", blur: 2 }}
/>
<Group justify="space-between">
<Title order={2}>Send a Message</Title>
<Controller
name="channel"
control={control}
render={({ field }) => (
<Select
variant="filled"
checkIconPosition="right"
placeholder="Select Channel"
data={chName}
searchable
nothingFoundMessage="No Channel Found"
error={errors && errors.channel?.message}
{...field}
/>
)}
/>
</Group>
<Textarea
className="my-3"
variant="filled"
label="Message"
withAsterisk
description="What you want to send to the Discord?"
placeholder="Hello, This is a message sent from Test Bot Dashboard Website"
autosize
minRows={5}
error={errors && errors.content?.message}
{...register("content")}
/>
<EmbedBuilder
register={register}
errors={errors}
setValue={setValue}
control={control}
isSubmitSuccessful={isSubmitSuccessful}
watch={watch}
/>
<Button type="submit" disabled={isSubmitting}>
Send
</Button>
</form>
</FormProvider>
22 replies
TTCTheo's Typesafe Cult
Created by TayyabCodes on 12/22/2023 in #questions
Problem with react-hook-form
which part of code you want?
22 replies
TTCTheo's Typesafe Cult
Created by TayyabCodes on 12/22/2023 in #questions
Problem with react-hook-form
const methods = useForm({
resolver: zodResolver(message),
});
const {
register,
handleSubmit,
control,
reset,
setValue,
watch,
formState: { errors, isSubmitSuccessful, isSubmitting },
} = methods;
const methods = useForm({
resolver: zodResolver(message),
});
const {
register,
handleSubmit,
control,
reset,
setValue,
watch,
formState: { errors, isSubmitSuccessful, isSubmitting },
} = methods;
that what i am doing
22 replies
TTCTheo's Typesafe Cult
Created by TayyabCodes on 12/22/2023 in #questions
Problem with react-hook-form
i have looked online many people just said you have used useForm() twice which i dont think i am doing
22 replies