Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

creatable select react

import React, { Component } from 'react';

import CreatableSelect from 'react-select/creatable';
import { ColourOption, colourOptions } from '../data';
import { ActionMeta, OnChangeValue } from 'react-select';

export default class CreatableSingle extends Component {
  handleChange = (
    newValue: OnChangeValue<ColourOption, false>,
    actionMeta: ActionMeta<ColourOption>
  ) => {
    console.group('Value Changed');
    console.log(newValue);
    console.log(`action: ${actionMeta.action}`);
    console.groupEnd();
  };
  handleInputChange = (inputValue: any, actionMeta: any) => {
    console.group('Input Changed');
    console.log(inputValue);
    console.log(`action: ${actionMeta.action}`);
    console.groupEnd();
  };
  render() {
    return (
      <CreatableSelect
        isClearable
        onChange={this.handleChange}
        onInputChange={this.handleInputChange}
        options={colourOptions}
      />
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: send data from servlet to hjsp 
Javascript :: jquery validate on keyup 
Javascript :: Create JavaScript Strings 
Javascript :: javascript email validation 
Javascript :: js reduce 
Javascript :: includes in js 
Javascript :: use of map in react 
Javascript :: regex for not accepting zeros 
Javascript :: angular infinite scroll 
Javascript :: how manipulate the multiple input option data in one function in vue js 
Javascript :: angular material datepicker range get value 
Javascript :: Get specific elements from an object by using filter method 
Javascript :: Setting axios base url dynamically 
Javascript :: how to add abutton component to drawer in react native 
Javascript :: javascript keep scroll visible 
Javascript :: blur js 
Javascript :: start animation with javascript 
Javascript :: encodeuricomponent reverse 
Javascript :: create new nx app 
Javascript :: remove duplicates javascript 
Javascript :: axios error handling 
Javascript :: javaScript setDate() Method 
Javascript :: Expected an identifier and instead saw ' 
Javascript :: node.js parameters 
Javascript :: vue js convert string to html 
Javascript :: how to make a dictionary javascript 
Javascript :: js regex find 
Javascript :: event after div created 
Javascript :: ejs to javascript array 
Javascript :: JavaScript setTimeout js function timer command 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =