Skip to content

OnChangeText clears the input when using useState hook #57

Description

@dislersd

Updating local state through onChangeText, clears the input anytime I type.

 const [item, setItem] = useState("")

<Autocomplete
    key={uuidv4()}
    inputStyle={styles.inputContainer}
    placeholder="building"
    onChangeText={text => setItem(text)} // <-- This is not working
    handleSelectItem={(item, id) => console.log(item, id)}
    data={items}
    minimumCharactersCount={2}
    valueExtractor={item => item}
  />

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions