SHARE
TWEET

Untitled

a guest Jun 19th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top