Skip to content

Instantly share code, notes, and snippets.

@blizzerand
Created November 29, 2018 14:08
Show Gist options
  • Save blizzerand/d2ab4a00b72c11720a317019f88f9534 to your computer and use it in GitHub Desktop.
Save blizzerand/d2ab4a00b72c11720a317019f88f9534 to your computer and use it in GitHub Desktop.
Select Form Element
/*Select.jsx*/
const Select = (props) => {
return(
<div className="form-group">
<label htmlFor={props.name}> {props.title} </label>
<select
name={props.name}
value={props.value}
onChange={props.handleChange}
>
<option value="" disabled>{props.placeholder}</option>
{props.options.map(option => {
return (
<option
key={option}
value={option}
label={option}>{option}
</option>
);
})}
</select>
</div>)
}
export default Select;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment