@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
13 lines (12 loc) • 701 B
TypeScript
import React from 'react';
import type { WithFieldOption } from '@douyinfe/semi-foundation/lib/cjs/form/interface';
import type { CommonFieldProps, CommonexcludeType } from '../interface';
import type { Subtract } from 'utility-types';
/**
* withFiled is used to inject components
* 1. Takes over the value and onChange of the component and synchronizes them to Form Foundation
* 2. Insert <Label>
* 3. Insert <ErrorMessage>
*/
declare function withField<C extends React.ElementType, T extends Subtract<React.ComponentProps<C>, CommonexcludeType> & CommonFieldProps & React.RefAttributes<any>, R extends React.ComponentType<T>>(Component: C, opts?: WithFieldOption): R;
export default withField;