How to use the react-select.propTypes 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 studentinsights / studentinsights / app / assets / javascripts / components / SimpleFilterSelect.js View on Github external
// null so that `placeholder` can be used to name what this component can filter when there's
// no value selecting, saving horizontal space.
export default function SimpleFilterSelect(props) {
  const {style, value} = props;
  return (
    <select placeholder="" value="{value" style="{{width:">
  );
}
SimpleFilterSelect.propTypes = {
  ...Select.propTypes,
  value: PropTypes.string.isRequired
};
</select>
github atomiclabs / hyperdex / app / renderer / components / Select.js View on Github external
import React from 'react';
import PropTypes from 'prop-types';
import ReactSelect from 'react-select';
import './Select.scss';

const Select = ({searchable, clearable, forwardedRef, ...props}) =&gt; {
	return ;
};

Select.propTypes = {
	...ReactSelect.propTypes,
	forwardedRef: PropTypes.oneOfType([
		PropTypes.elementType,
		PropTypes.object,
	]),
};

Select.defaultProps = {
	// Rule disabled because of https://github.com/yannickcr/eslint-plugin-react/issues/1674
	/* eslint-disable react/default-props-match-prop-types */
	clearable: false,
	searchable: false,
	/* eslint-enable react/default-props-match-prop-types */
	forwardedRef: undefined,
};

export default React.forwardRef((props, ref) =&gt; (
github getsentry / sentry / src / sentry / static / sentry / app / components / forms / selectControl.jsx View on Github external
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
    multi: PropTypes.bool,
    // disable rendering a menu
    noMenu: PropTypes.bool,
    choices: PropTypes.oneOfType([
      PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.array])),
      PropTypes.func,
github startups-services / epic-admin-dashboard / components / Forms / AssigneeForm.js View on Github external
isSearchable={false}
      defaultValue={null}
      isClearable
      components={{ Placeholder }}
      placeholder={
        
      }
      styles={customStyles}
      {...rest}
    /&gt;

  
);
AssigneeForm.propTypes = {
  size: PropTypes.string.isRequired,
  ...Select.propTypes,
};

export default AssigneeForm;
github mpigsley / sectors-without-number / src / primitives / form / dropdown / index.js View on Github external
'Dropdown-Select--up': dropUp,
          'Dropdown-Select--icon': icon,
        })}
        optionClassName="Dropdown-Option"
      /&gt;
      {icon &amp;&amp; (
        <div>
          
        </div>
      )}
    
  );
}

Dropdown.propTypes = {
  ...Select.propTypes,
  dropUp: PropTypes.bool,
  allowCreate: PropTypes.bool,
  wrapperClassName: PropTypes.string,
  onItemClick: PropTypes.func,
};

Dropdown.defaultProps = {
  dropUp: false,
  allowCreate: false,
  wrapperClassName: null,
  onItemClick: () =&gt; {},
};