Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (20 loc) · 878 Bytes

File metadata and controls

31 lines (20 loc) · 878 Bytes

The useForm hook

We are using react-hook-form for forms, including feature configuration or settings page

Built-in Components

There're some common components such as <FilePicker /> in the src/components/forms/* folder

Controller

We add useController into custom components so as to provides better code quality

Therefore, You don't have to wrap the inputs into the <Controller /> component

For example, the Color picker & Switch field can be used in this way

<ColorPickerForm
  control={{
    label: 'Color',
    description: 'The color of message',
  }}
  controller={{ control, name: 'color' }} //from the useForm hook
/>

Learn More

Example

Take a look at here for examples