mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 21:18:01 +08:00
0647f56856
* feat: CheckboxGroup type infer fix: fix type error fix: define type infer chore: opti type * Update type.test.tsx Signed-off-by: lijianan <574980606@qq.com> * Update Group.tsx Signed-off-by: lijianan <574980606@qq.com> --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: gushuo <gushuo@yoycol.com> Co-authored-by: lijianan <574980606@qq.com>
16 lines
474 B
TypeScript
16 lines
474 B
TypeScript
import React from 'react';
|
|
import type { CheckboxOptionType, CheckboxValueType } from './Group';
|
|
|
|
export interface CheckboxGroupContext<T extends CheckboxValueType = CheckboxValueType> {
|
|
name?: string;
|
|
toggleOption?: (option: CheckboxOptionType) => void;
|
|
value?: any;
|
|
disabled?: boolean;
|
|
registerValue: (val: T) => void;
|
|
cancelValue: (val: T) => void;
|
|
}
|
|
|
|
const GroupContext = React.createContext<CheckboxGroupContext | null>(null);
|
|
|
|
export default GroupContext;
|