javascript - How can I use React icons in Placeholder? -


is possible use react icons in placeholder attribute of input field i-e input text example?

if yes can 1 give me example?

i instead of icon got [object object] in placeholder

var  emailicon = <faenvelopeo  size={10}  />; <field  placeholder={emailicon}  name="email"  type="text"  component={this.renderfield} /> 

nope, placeholders meant contain text only. @ definition below:

the placeholder attribute places text inside input in light gray color. text remains whenever input has no value.

you can use hexcodes below:

<input type="text" placeholder="&#xf002;" style="font-family:arial, fontawesome" /> 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -