File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/components/forms/controlled Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ type MakeControlled<T extends React.ComponentType<any>> =
77 name : string ;
88 emptyDisabledValue ?: boolean ;
99 } ;
10+ type MakeControlledCheckbox < T extends React . ComponentType < any > > =
11+ Omit < React . ComponentPropsWithoutRef < T > , 'checked' > & {
12+ name : string ;
13+ emptyDisabledValue ?: boolean ;
14+ } ;
1015
1116const useEmptyDisabledValue = (
1217 props : { disabled ?: boolean ; emptyDisabledValue ?: boolean } ,
@@ -67,7 +72,7 @@ export const TextArea = (props: MakeControlled<typeof Uncontrolled.TextArea>) =>
6772 /> ;
6873} ;
6974
70- export const Radio = ( props : MakeControlled < typeof Uncontrolled . Radio > ) => {
75+ export const Radio = ( props : MakeControlledCheckbox < typeof Uncontrolled . Radio > ) => {
7176 const { data, namespace, setInput} = useFormHelpers ( ) ;
7277
7378 const onChangeValue = ( value : string ) => {
@@ -85,7 +90,7 @@ export const Radio = (props: MakeControlled<typeof Uncontrolled.Radio>) => {
8590 /> ;
8691} ;
8792
88- export const Checkbox = ( props : MakeControlled < typeof Uncontrolled . Checkbox > ) => {
93+ export const Checkbox = ( props : MakeControlledCheckbox < typeof Uncontrolled . Checkbox > ) => {
8994 const { data, namespace, setInput} = useFormHelpers ( ) ;
9095
9196 const onChangeValue = ( value : boolean | undefined ) => {
You can’t perform that action at this time.
0 commit comments