Skip to content Skip to sidebar Skip to footer

How Do I Disable A Creatable React-select Component?

I can't figure out what prop to use to disable a Creatable React-select component, is it just missing? I tried the regular isDisabled prop but was unsuccessful.

Solution 1:

The isDisabled prop for Select components is applicable for react-select v2 and above. In case you are using a version 1.x.x please use the disabled prop to disable the select component

render() {
    return (
      <CreatableSelect
        isClearable
        isDisabled
        onChange={this.handleChange}
        onInputChange={this.handleInputChange}
        options={colourOptions}
      />
    );
  }

Working demo with v2


Post a Comment for "How Do I Disable A Creatable React-select Component?"