Skip to content

OnChangeText clears the input when using useState hook #57

@dislersd

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}
  />

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