How to use the react-select.Async function in react-select

To help you get started, we’ve selected a few react-select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Clever / components / src / Select / Select.jsx View on Github external
if (required) {
    inputNote = <span>required</span>;
  }

  let reactSelectClasses = cssClass.REACT_SELECT;
  if (readOnly) {
    reactSelectClasses += ` ${cssClass.READ_ONLY}`;
  }

  let SelectComponent = ReactSelect;
  if (creatable &amp;&amp; lazy) {
    SelectComponent = ReactSelect.AsyncCreatable;
  } else if (creatable) {
    SelectComponent = ReactSelect.Creatable;
  } else if (lazy) {
    SelectComponent = ReactSelect.Async;
  }

  // The label container must be returned after the ReactSelect otherwise it does not get displayed
  // in the browser.
  return (
    <div>
      <div id="{id}">
        </div></div>
github oknosoft / metadata.js / packages / metadata-react / DataField / VirtualizedSelect.js View on Github external
_getSelectComponent() {
    const {async, selectComponent} = this.props;

    if (selectComponent) {
      return selectComponent;
    } else if (async) {
      return Select.Async;
    } else {
      return Select;
    }
  }
github bowtie-co / houndstooth-ui / src / components / molecules / Field / Select / Select.jsx View on Github external
const SelectBT = ({ col, options, async, name, onChange, value, list, className = '', edited, ...rest }) =&gt; {
  const SelectComponent = async ? Select.Async : Select
  const { valueKey, labelKey } = rest

  options = list ? selectLists[list] : options

  if (options &amp;&amp; Array.isArray(options) &amp;&amp; options.length &gt; 0 &amp;&amp; typeof options[0] !== 'object') {
    options = options.reduce((arr, option) =&gt; {
      const value = typeof option === 'object' ? option[valueKey] : option
      const text = typeof option === 'object' ? option[labelKey] : option

      return [...arr, { label: text, value }]
    }, [])
  }

  return (
github appbaseio / reactivemaps / lib / sensors / GeoDistanceDropdown.js View on Github external
"rbc-title-inactive": !this.props.title,
			"rbc-placeholder-active": this.props.placeholder,
			"rbc-placeholder-inactive": !this.props.placeholder
		}, this.props.className);

		return React.createElement(
			"div",
			{ className: "rbc rbc-geodistancedropdown clearfix card thumbnail col s12 col-xs-12 " + cx, style: this.props.style },
			React.createElement(
				"div",
				{ className: "row" },
				title,
				React.createElement(
					"div",
					{ className: "rbc-search-container col s12 col-xs-12" },
					React.createElement(Select.Async, {
						value: this.state.currentValue,
						loadOptions: this.loadOptions,
						placeholder: this.props.placeholder,
						onChange: this.handleChange,
						filterOption: function filterOption() {
							return true;
						},
						valueRenderer: this.renderValue
					})
				),
				React.createElement(
					"div",
					{ className: "col s12 col-xs-12" },
					React.createElement(Select, {
						name: "distance",
						placeholder: this.props.placeholderDropdown,
github bvaughn / react-virtualized-select / source / VirtualizedSelect / VirtualizedSelect.js View on Github external
_getSelectComponent () {
    const { async, selectComponent } = this.props

    if (selectComponent) {
      return selectComponent
    } else if (async) {
      return Select.Async
    } else {
      return Select
    }
  }
github adityaparmar03 / Dropbox-v3.0 / client / src / components / home.js View on Github external
render() {
        const AsyncComponent = Select.Async
        return (
            <div>  
               
            <div>
                <div>
                <menu>
                </menu></div>
                <div>
               
                     this.msg = a} {...this.alertOptions} /&gt;
                    <div style="{{marginTop:&quot;5%&quot;}}">
                        <h4>Dropbox</h4>
                    </div>
                    

                    </div></div></div>
github appbaseio / reactivemaps / lib / sensors / PlacesSearch.js View on Github external
"rbc-title-inactive": !this.props.title,
			"rbc-placeholder-active": this.props.placeholder,
			"rbc-placeholder-inactive": !this.props.placeholder
		}, this.props.className);

		return React.createElement(
			"div",
			{ className: "rbc rbc-placessearch clearfix card thumbnail col s12 col-xs-12 " + cx, style: this.props.style },
			React.createElement(
				"div",
				{ className: "row" },
				title,
				React.createElement(
					"div",
					{ className: "col s12 col-xs-12" },
					React.createElement(Select.Async, {
						value: this.state.currentValue,
						loadOptions: this.loadOptions,
						placeholder: this.props.placeholder,
						onChange: this.handleChange,
						valueRenderer: this.renderValue
					})
				)
			)
		);
	};
github JedWatson / react-select / examples / src / components / GithubUsers.js View on Github external
render () {
		const AsyncComponent = this.state.creatable
			? Select.AsyncCreatable
			: Select.Async;

		return (
			<div>
				<h3>{this.props.label} <a href="https://github.com/JedWatson/react-select/tree/master/examples/src/components/GithubUsers.js">(Source)</a></h3>
				
				<div>
					<label>
						<input checked="{this.state.multi}" type="radio">
						<span>Multiselect</span>
					</label>
					<label>
						<input checked="{!this.state.multi}" type="radio">
						<span>Single Value</span>
					</label>
				</div>
				<div></div></div>