nishiki-tech / nishiki-frontend

Nishiki is an app for tracking and sharing food inventories within groups for better pantry management.
https://nishiki.tech
MIT License
20 stars 5 forks source link

Refactor CategorySelect component #175

Closed nick-y-ito closed 8 months ago

nick-y-ito commented 8 months ago

Description

The state definition of the selected category must be defined outside of the CategorySelect component to utilize the react-hook-form library, which is used by shadcn/ui internally.

Criteria

Instead of defining the following state within the CategorySelect component, modify it to receive them as props from a parent component.

  const [selectedCategory, setSelectedCategory] = useState<string>('unselected');

Notes

-