Skip to content

Commit 702b4a3

Browse files
committed
fix(Input): fix input style=[], extraStart 穿字符串报错
1 parent 916e625 commit 702b4a3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/core/src/Input/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default class Input extends React.Component<InputProps, InputState> {
114114
renderClear,
115115
extraStart,
116116
extraEnd,
117-
style,
117+
style = [],
118118
containerStyle,
119119
border = 'bottom',
120120
borderColor = '#ccc',
@@ -139,7 +139,11 @@ export default class Input extends React.Component<InputProps, InputState> {
139139
]}
140140
>
141141
<View style={[inputStyles.container, { flex: 1, borderColor: borderColor }, border ? inputStyles[border] : {}]}>
142-
{typeof extraEnd === 'string' ? <Text style={{ color: '#888888', fontSize }}>{extraStart}</Text> : extraStart}
142+
{typeof extraStart === 'string' ? (
143+
<Text style={{ color: '#888888', fontSize }}>{extraStart}</Text>
144+
) : (
145+
extraStart
146+
)}
143147
<TextInput
144148
{...others}
145149
ref={inputRef}

0 commit comments

Comments
 (0)