Skip to content

Commit a67c341

Browse files
authored
TextField - fix placeholder memoization (#1674)
1 parent fa672a6 commit a67c341

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/textField/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,8 @@ export default class TextField extends BaseInput {
275275
}
276276
};
277277

278-
getPlaceholderText = memoize(() => {
278+
getPlaceholderText = memoize((placeholder, helperText) => {
279279
// HACK: passing whitespace instead of undefined. Issue fixed in RN56
280-
const {placeholder, helperText} = this.props;
281280
const text = this.shouldFakePlaceholder()
282281
? this.shouldShowHelperText()
283282
? helperText
@@ -588,6 +587,8 @@ export default class TextField extends BaseInput {
588587
expandable,
589588
rightIconSource,
590589
color,
590+
placeholder,
591+
helperText,
591592
...others
592593
} = this.getThemeProps();
593594

@@ -610,7 +611,7 @@ export default class TextField extends BaseInput {
610611
style
611612
];
612613

613-
const placeholderText = this.getPlaceholderText();
614+
const placeholderText = this.getPlaceholderText(placeholder, helperText);
614615
const placeholderColor = this.getStateColor(placeholderTextColor || PLACEHOLDER_COLOR_BY_STATE.default);
615616
const isEditable = !this.isDisabled() && !expandable;
616617

0 commit comments

Comments
 (0)