Skip to content

Commit

Permalink
fix(hippy-react): text-input style
Browse files Browse the repository at this point in the history
  • Loading branch information
tsangint authored and xuqingkuang committed Mar 16, 2020
1 parent 2585bc5 commit a9fa8d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/hippy-react/src/components/text-input.tsx
Expand Up @@ -291,7 +291,11 @@ class TextInput extends React.Component<TextInputProps, {}> {
const nativeProps = { ...this.props };
['underlineColorAndroid', 'placeholderTextColor', 'placeholderTextColors'].forEach((prop) => {
if (typeof (this.props as any)[prop] === 'string') {
if (typeof nativeProps.style === 'object') {
if (Array.isArray(nativeProps.style)) {
nativeProps.style.push({
[prop]: (this.props as any)[prop],
});
} else if (typeof nativeProps.style === 'object') {
(nativeProps.style as any)[prop] = (this.props as any)[prop];
} else {
nativeProps.style = {
Expand Down

0 comments on commit a9fa8d1

Please sign in to comment.