Instructor: We have a simple form which allows us to select libraries/frameworks from npm and install it. It consists of a single field with component set to select remap through libraries in order to generate the option values. The libraries, it's an array of objects. Each one of those objects has value and label.
Suppose that, for instance, we would like to be able to press V on keyboard and search for Vue. Of course, we can go ahead and implement it ourselves, but there are plenty of solutions from npm. For instance, we could use something called React Select to achieve this effect.
To use React Select, import Select from 'react-select'. To use an external React Select instead of the native select, we need to create an adapter.
To create an adapter, create a stateless functional component. In this case, we're going to call it react-select-adapter. It is a function that is going to accept an object. From this object, we're going to destructure the input and all the rest that was provided to this component.
We're going to return the react-select. We're going to pass in the input. We're going to pass it also the rest of what was provided. We're also going to set this searchable prop to true.
Next, use the react-select-adapter as a component in our filled component. Instead of providing the options as children, we're going to remove this part. Instead, we're going to specify an options object that is going to be set to our libraries. Let me format that.
If I clicked on this Select, I have all the options. Also, I can search for Vue. I can install Vue from npm.