text: import React, { Component } from 'react';
  
  import AsyncSelect from 'react-select/lib/Async';
  import { colourOptions } from './docs/data';
  
  type State = {
    inputValue: string,
  };
  
  const filterColors = (inputValue: string) => {
    return colourOptions.filter(i =>
      i.label.toLowerCase().includes(inputValue.toLowerCase())
    );
  };
  
  const promiseOptions = inputValue =>
    new Promise(resolve => {
      setTimeout(() => {
        resolve(filterColors(inputValue));
      }, 1000);
    });
  
  export default class AsyncMulti extends Component<*, State> {
    state = { inputValue: '' };
    handleInputChange = (newValue: string) => {
      const inputValue = newValue.replace(/\W/g, '');
      this.setState({ inputValue });
      return inputValue;
    };
    render() {
      return (
        <AsyncSelect
          className="react-select-multi"
          classNamePrefix="react-select-multi"
          isMulti
          cacheOptions
          defaultOptions
          loadOptions={promiseOptions}
        />
      );
    }
  }
  