How to use the react-select/lib/Creatable.default 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 meetalva / alva / packages / components / src / create-select / create-select.tsx View on Github external
import { Color } from '../colors';
import * as React from 'react';
import { ChevronIcon } from '../select';

// tslint:disable-next-line:no-submodule-imports
const CreatableSelect = require('react-select/lib/Creatable').default;

export type CreateSelectActionType =
	| 'clear'
	| 'create-option'
	| 'deselect-option'
	| 'pop-value'
	| 'remove-value'
	| 'select-option'
	| 'set-value';

export type CreateSelectAction =
	| { action: 'clear' | 'create-option' | 'deselect-option' | 'select-option' | 'set-value' }
	| { action: 'pop-value' | 'remove-value'; removedValue: CreateSelectOption };

export interface CreateSelectProps {
	autoFocus?: boolean;
github laurent22 / joplin / ElectronClient / app / gui / PromptDialog.jsx View on Github external
const React = require('react');
const { _ } = require('lib/locale.js');
const { themeStyle } = require('../theme.js');
const { time } = require('lib/time-utils.js');
const Datetime = require('react-datetime');
const CreatableSelect = require('react-select/lib/Creatable').default;
const Select = require('react-select').default;
const makeAnimated = require('react-select/lib/animated').default;

class PromptDialog extends React.Component {
	constructor() {
		super();

		this.answerInput_ = React.createRef();
	}

	componentWillMount() {
		this.setState({
			visible: false,
			answer: this.props.defaultValue ? this.props.defaultValue : '',
		});
		this.focusInput_ = true;