@@ -159,6 +159,14 @@ const TextField = (props: InternalTextFieldProps) => {
159159 return { ...fieldState , disabled : others . editable === false , validateField} ;
160160 } , [ fieldState , others . editable , validateField ] ) ;
161161
162+ const leadingAccessoryClone = useMemo ( ( ) => {
163+ if ( leadingAccessory ) {
164+ return React . cloneElement ( leadingAccessory , {
165+ ref : leadingAccessoryRef
166+ } ) ;
167+ }
168+ } , [ leadingAccessory ] ) ;
169+
162170 const { margins, paddings, typography, color} = modifiers ;
163171 const typographyStyle = useMemo ( ( ) => omit ( typography , 'lineHeight' ) , [ typography ] ) ;
164172 const colorStyle = useMemo ( ( ) => color && { color} , [ color ] ) ;
@@ -188,8 +196,7 @@ const TextField = (props: InternalTextFieldProps) => {
188196 ) }
189197 < View style = { [ paddings , fieldStyle ] } row centerV >
190198 { /* <View row centerV> */ }
191- { /* @ts -expect-error */ }
192- { leadingAccessory && < View ref = { leadingAccessoryRef } > { leadingAccessory } </ View > }
199+ { leadingAccessoryClone }
193200 < View flexG >
194201 { floatingPlaceholder && (
195202 < FloatingPlaceholder
0 commit comments