@@ -159,6 +159,14 @@ const TextField = (props: InternalTextFieldProps) => {
159
159
return { ...fieldState , disabled : others . editable === false , validateField} ;
160
160
} , [ fieldState , others . editable , validateField ] ) ;
161
161
162
+ const leadingAccessoryClone = useMemo ( ( ) => {
163
+ if ( leadingAccessory ) {
164
+ return React . cloneElement ( leadingAccessory , {
165
+ ref : leadingAccessoryRef
166
+ } ) ;
167
+ }
168
+ } , [ leadingAccessory ] ) ;
169
+
162
170
const { margins, paddings, typography, color} = modifiers ;
163
171
const typographyStyle = useMemo ( ( ) => omit ( typography , 'lineHeight' ) , [ typography ] ) ;
164
172
const colorStyle = useMemo ( ( ) => color && { color} , [ color ] ) ;
@@ -188,8 +196,7 @@ const TextField = (props: InternalTextFieldProps) => {
188
196
) }
189
197
< View style = { [ paddings , fieldStyle ] } row centerV >
190
198
{ /* <View row centerV> */ }
191
- { /* @ts -expect-error */ }
192
- { leadingAccessory && < View ref = { leadingAccessoryRef } > { leadingAccessory } </ View > }
199
+ { leadingAccessoryClone }
193
200
< View flexG >
194
201
{ floatingPlaceholder && (
195
202
< FloatingPlaceholder
0 commit comments