UNPKG

@blueprintjs-formik/core

Version:
30 lines (29 loc) 1.22 kB
import * as React from 'react'; import { FieldConfig, FieldProps } from 'formik'; import { RadioGroupProps as BPRadioGroupProps } from '@blueprintjs/core'; export interface RadioGroupProps extends Omit<BPRadioGroupProps, 'onChange'>, Omit<FieldConfig, 'component'> { name: string; onChange?: (event: React.FormEvent<HTMLInputElement>) => void; } interface FieldToRadioGroupProps extends FieldProps, Omit<BPRadioGroupProps, 'onChange'> { onChange?: (event: React.FormEvent<HTMLInputElement>) => void; } /** * Transforms the field props to radio group component. * @param {FieldToRadioGroupProps} * @returns {BPRadioGroupProps} */ export declare function fieldToRadioGroup({ field, form, onChange, ...props }: FieldToRadioGroupProps): BPRadioGroupProps; /** * Transforms the field props to radio group component. * @param {FieldToRadioGroupProps} * @returns {JSX.Element} */ export declare function FieldToRadioGroup(props: FieldToRadioGroupProps): JSX.Element; /** * Radio group wrap BP component to bind with Formik. * @param {RadioGroupProps} * @returns {JSX.Element} */ export declare function RadioGroup(props: RadioGroupProps): JSX.Element; export {};