[change] Remove 'placeholderTextColor' from 'createElement' props

TextInput converts the 'placeholderTextColor' prop to a style.
This commit is contained in:
Nicolas Gallagher
2019-12-21 16:57:11 +00:00
parent e670e8135b
commit 287251a06a
2 changed files with 7 additions and 6 deletions
+6 -1
View File
@@ -18,6 +18,7 @@ import css from '../StyleSheet/css';
import filterSupportedProps from '../View/filterSupportedProps';
import findNodeHandle from '../findNodeHandle';
import React from 'react';
import StyleSheet from '../StyleSheet';
import TextInputState from '../../modules/TextInputState';
const isAndroid = canUseDOM && /Android/i.test(navigator && navigator.userAgent);
@@ -111,6 +112,7 @@ class TextInput extends React.Component<TextInputProps> {
returnKeyType,
secureTextEntry = false,
spellCheck,
style,
value
} = this.props;
@@ -163,10 +165,13 @@ class TextInput extends React.Component<TextInputProps> {
onKeyPress: this._handleKeyPress,
onSelect: normalizeEventHandler(this._handleSelectionChange),
placeholder,
placeholderTextColor,
readOnly: !editable,
ref: this._setNode,
spellCheck: spellCheck != null ? spellCheck : autoCorrect,
style: StyleSheet.compose(
style,
placeholderTextColor && { placeholderTextColor }
),
value
});
@@ -70,7 +70,6 @@ const createDOMProps = (component, props, styleResolver) => {
disabled: providedDisabled,
importantForAccessibility,
nativeID,
placeholderTextColor,
pointerEvents,
style: providedStyle,
testID,
@@ -171,10 +170,7 @@ const createDOMProps = (component, props, styleResolver) => {
// STYLE
const reactNativeStyle = StyleSheet.compose(
pointerEvents && pointerEventsStyles[pointerEvents],
StyleSheet.compose(
providedStyle,
placeholderTextColor && { placeholderTextColor }
)
providedStyle
);
// Additional style resets for interactive elements