How to use the react-select.Value 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 getsentry / sentry / src / sentry / static / sentry / app / components / forms / selectControl.jsx View on Github external
import PropTypes from 'prop-types';
import React from 'react';
import ReactSelect, {Async, Creatable, AsyncCreatable} from 'react-select';
import styled, {css} from 'react-emotion';

import convertFromSelect2Choices from 'app/utils/convertFromSelect2Choices';

/**
 * The library has `value` defined as `PropTypes.object`, but this
 * is not the case when `multiple` is true :/
 */
ReactSelect.Value.propTypes = {
  ...ReactSelect.Value.propTypes,
  value: PropTypes.any,
};

export default class SelectControl extends React.Component {
  static propTypes = {
    ...ReactSelect.propTypes,
    options: PropTypes.arrayOf(
      PropTypes.shape({
        label: PropTypes.node,
        value: PropTypes.any,
      })
    ),
    // react-select knows this as multi, but for standardization
    // and compatibility we use multiple
    multiple: PropTypes.bool,
    // multi is supported for compatibility
github getsentry / sentry / src / sentry / static / sentry / app / components / forms / selectControl.jsx View on Github external
import PropTypes from 'prop-types';
import React from 'react';
import ReactSelect, {Async, Creatable, AsyncCreatable} from 'react-select';
import styled, {css} from 'react-emotion';

import convertFromSelect2Choices from 'app/utils/convertFromSelect2Choices';

/**
 * The library has `value` defined as `PropTypes.object`, but this
 * is not the case when `multiple` is true :/
 */
ReactSelect.Value.propTypes = {
  ...ReactSelect.Value.propTypes,
  value: PropTypes.any,
};

export default class SelectControl extends React.Component {
  static propTypes = {
    ...ReactSelect.propTypes,
    options: PropTypes.arrayOf(
      PropTypes.shape({
        label: PropTypes.node,
        value: PropTypes.any,
      })
    ),
    // react-select knows this as multi, but for standardization
    // and compatibility we use multiple
    multiple: PropTypes.bool,