fix(www): register field array input once (#466)

Closes: #465

Co-authored-by: shadcn <m@shadcn.com>
This commit is contained in:
moshyfawn
2023-05-29 03:20:43 -04:00
committed by GitHub
parent 71f496d41f
commit 042554ad07

View File

@@ -157,8 +157,8 @@ export function ProfileForm() {
<FormField
control={form.control}
key={field.id}
name={`urls.${index}`}
render={() => (
name={`urls.${index}.value`}
render={({ field }) => (
<FormItem>
<FormLabel className={cn(index !== 0 && "sr-only")}>
URLs
@@ -167,7 +167,7 @@ export function ProfileForm() {
Add links to your website, blog, or social media profiles.
</FormDescription>
<FormControl>
<Input {...form.register(`urls.${index}.value`)} />
<Input {...field} />
</FormControl>
<FormMessage />
</FormItem>