Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import React from 'react';
  2.  
  3. const Select = props => {
  4.  
  5. let formControl = "form-control";
  6.  
  7. if (props.touched && !props.valid) {
  8. formControl = 'form-control control-error';
  9. }
  10.  
  11. return (
  12. <div className="form-group">
  13. <select className={formControl} value={props.value} onChange={props.onChange} name={props.name}>
  14. {props.options.map(option => (
  15. <option value={option.value}>
  16. {option.displayValue}
  17. </option>
  18. ))}
  19. </select>
  20. </div>
  21. );
  22. }
  23.  
  24. export default Select;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement