concept Autocomplete component in category react
appears as: Autocomplete component, The Autocomplete component

This is an excerpt from Manning's book React Quickly: Painless web apps with React, JSX, Redux, and GraphQL.
The Autocomplete component is self-sufficient, meaning it isn’t just a view component but can also fetch from and save to the REST API. It has two properties: options and url. In accordance with TDD, let’s start coding the Autocomplete component with tests.
Finally, it’s time to write the Autocomplete component (ch20/autocomplete/src/autocomplete.jsx). It includes the input field, the list of matching options, and the Add button to add a new option when there are no matches. The component performs two AJAX/XHR calls: to retrieve a list of options and to create a new option. There are two methods: