import React, { FunctionComponent } from 'react'; import { useFormContext } from 'react-hook-form'; import type { ISlackChannelsSelectorProps } from './SlackChannelsSelector.types'; import { DropListPicker, IReportFormValues } from '../../../../components'; export const SlackChannelsSelector: FunctionComponent = ({ options, ...dropListPickerProps }) => { const { setValue, watch, errors } = useFormContext(); return ( setValue('slackChannel', val)} error={errors.slackChannel?.message} /> ); };