skip to Main Content

I am very new with react native and as part of my trial app development I am trying to create a form for registration.

Here is the snack

Here as you can see I am trying to use the react native paper for textinput. But the icon is not at all showing even there is space for icon is showing.

enter image description here

I thought its the problem with simulator in snack, but when trying the same in phone using expo, its not showing the icon.

Please help

<TextInput
      mode="outlined"
      label="Email"
      onChangeText={(email) => setFullName(email)}
      style={styles.TextInput}
      left={
        <TextInput.Icon name="account" size={24} color="#fff" />
      }
    />

2

Answers


  1. You should be using an icon attribute there:

    <TextInput left={<TextInput.Icon icon="account"/>}/>
    

    It looks like so:

    enter image description here

    Login or Signup to reply.
  2. i was also facing the same issue , by replacing name with icon it worked for me

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search