Created
December 22, 2017 22:14
-
-
Save jmlavoier/e0a3bebb6ad647f796da0c37f5cbc9cf to your computer and use it in GitHub Desktop.
It's a dumb component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SelectField.js | |
import React from 'react'; | |
export const SelectField = ({ | |
value, | |
name, | |
type, | |
options, | |
style, | |
onChange, | |
}) => ( | |
<div> | |
<select | |
name={name} | |
value={value} | |
style={style} | |
onChange={onChange} | |
> | |
<option value="">Select</option> | |
{options.map((option, index) => ( | |
<option | |
key={index} | |
value={option} > | |
{option} | |
</option> | |
))} | |
</select> | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment