BelkacemYerfa / shadcn-extension

An open source component collection , that extends your ui library , built using shadcn component
https://shadcn-extension.vercel.app/
MIT License
460 stars 15 forks source link

Multi Select with react-hook-form has issues #70

Closed Roopaish closed 2 weeks ago

Roopaish commented 2 weeks ago

In the react hook form, the value that is in field is undefined initially , which can't be iterated and it causes client side exception.

I fixed it by making this change

const MultiSelector = ({
  values,
  onValuesChange: onValueChange,
  loop = false,
  className,
  children,
  dir,
  ...props
}: MultiSelectorProps) => {
const value = Array.isArray(values) ? values : []
.....