Skip to content

How to set the value? Is this possible? #289

@gcb

Description

@gcb

Let's say I want to add items to a list (similar to the "tags" functionality)

const [newText, setNewText] = useState('');
function createItem(label :string){
   ... create item and:
   setNewText(''); // DOES NOTHING
}

return(
<AutoComplete
  value={newText}
  onChange={x => createItem(x)}
...
)

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