Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 && 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>
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 &&
<label>
{label}
</label>}
</div>
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>