How to use the react-select.AsyncCreatable 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
labelClasses += ` ${cssClass.LABEL_HIDDEN}`;
  }

  let inputNote;
  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 cloudflare / cf-ui / packages / cf-component-select / src / Select.js View on Github external
render() {
    const {
      async,
      creatable,
      searchable,
      label,
      className,
      ...props
    } = this.props;

    let SelectClass;
    if (async) {
      SelectClass = creatable ? ReactSelect.AsyncCreatable : ReactSelect.Async;
    } else {
      SelectClass = creatable ? ReactSelect.Creatable : ReactSelect;
    }

    return (
      <div>
        {label &amp;&amp;
          <label>
            {label}
          </label>}
        </div>
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>