Every line of 'react-select npm' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
16 function select (state) { 17 return state.browser; 18 }
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code
41 function select(state) { 42 const stateObj = get(store.getState(), state); 43 44 if (stateObj === undefined) { 45 throw new Error(`State ${state} does not exist`); 46 } 47 48 return stateObj; 49 }
29 get name() { 30 return 'npm'; 31 }
16 export default function Select(props: ISelectProps) { 17 const formGroupClass = `form-group ${props.className}`; 18 19 const selectClass = `form-control ${props.validationErrors !== undefined && 20 props.validationErrors.length > 0 21 ? "is-invalid" 22 : ""}`; 23 24 const options = props.options.map(so => ( 25 <option key={so.value} value={so.value}> 26 {so.display} 27 </option> 28 )); 29 30 return ( 31 <div className={formGroupClass}> 32 <label htmlFor={props.id}>{props.label}</label> 33 <select 34 id={props.id} 35 value={props.value} 36 onChange={props.handleChange} 37 className={selectClass} 38 > 39 {props.includeEmptyOption !== undefined && props.includeEmptyOption ? ( 40 <option value="" /> 41 ) : null} 42 {options} 43 </select> 44 {props.validationErrors !== undefined ? ( 45 <ValidationErrorMessage messages={props.validationErrors} /> 46 ) : null} 47 </div> 48 ); 49 }
15 function Select(props){ 16 const items=props.items; 17 const optionItems=items.map((item)=> 18 <OptionItem key={item.toString()} value={item} /> 19 ); 20 21 return ( 22 <select>{optionItems}</select> 23 ); 24 }
11 function Select(props: IProps) { 12 const { options, ...textInputProps } = props; 13 return ( 14 <TextField select {...textInputProps} fullWidth> 15 {options.map(({ value, label }: ISelectOption) => <MenuItem value={value} key={value}>{label}</MenuItem>)} 16 </TextField> 17 ); 18 }
21 select: function select(obj) { 22 return OS in obj ? obj[OS] : obj.default; 23 }
4 export default function Select({initValue, label, onChange, options}) { 5 const [value, setValue] = useState(initValue) 6 7 const handleChangeSelect = event => { 8 const {value} = event.target 9 setValue(value) 10 onChange(value) 11 } 12 13 if (!Object.keys(options).length) { 14 return null 15 } 16 17 return ( 18 <label className="Select"> 19 <span className="Select-label">{label}</span> 20 <select value={value} onChange={handleChangeSelect}> 21 {Object.keys(options).map(option => ( 22 <option key={option} value={option}> 23 {option} 24 </option> 25 ))} 26 </select> 27 </label> 28 ) 29 }
9 export default function selectBundle(config = {}) { 10 let bundle; 11 if (config.hlsjs) { 12 bundle = loadHlsJsBundle(config); 13 } else if (config.flvjs) { 14 bundle = loadFlvJsBundle(config); 15 } else { 16 bundle = loadHtml5Bundle(config); 17 } 18 return bundle; 19 }
7 function selectId(selectedId) { 8 return function selectId(touchEvent) { 9 return (touchEvent.identifier || 0) === selectedId; 10 }; 11 }