0

placeholderTextColor does not work on my TextField

My code is here: https://codesandbox.io/s/74k5n65x1x?fontsize=14

I expected placeholderTextColor to change the color of the placeholder text, however the color of the placeholder text remains unchanged.

Sem
  • 5
  • 2
  • 2
    Possible duplicate of [Styling the placeholder in a TextField](https://stackoverflow.com/questions/47804380/styling-the-placeholder-in-a-textfield) – Gonzalo.- Apr 04 '19 at 16:37
  • None of the solutions at that link worked for me. However it seems like the answer is - you can't really do it. – Sem Apr 04 '19 at 17:24

2 Answers2

1

According to the documentation, there is no placeholderTextColor for the TextField component.

Gaël S
  • 1,598
  • 6
  • 15
1

it will be better if you post the code here.

anyway TextField doesn't have property called placeholderTextColor , instead you can add class to your text field

<TextField
    className="some-class"
    placeholder="Enter a message, hit return..."
/>

and in your css file

.some-class input::placeholder {
  color: blue !important;
}

don't forget to import your css file

Ali Faris
  • 17,754
  • 10
  • 45
  • 70