Skip to content

Commit

Permalink
fix(www): register field array input once (#466)
Browse files Browse the repository at this point in the history
Closes: #465

Co-authored-by: shadcn <[email protected]>
  • Loading branch information
Moshyfawn and shadcn authored May 29, 2023
1 parent 71f496d commit 042554a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/www/app/examples/forms/profile-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand Down

1 comment on commit 042554a

@vercel
Copy link

@vercel vercel bot commented on 042554a May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./apps/www

ui.shadcn.com
example-playground.vercel.app
ui-git-main-shadcn-pro.vercel.app
ui-shadcn-pro.vercel.app

Please sign in to comment.