Skip to content

Instantly share code, notes, and snippets.

@jmlavoier
Created December 22, 2017 22:14
Show Gist options
  • Save jmlavoier/e0a3bebb6ad647f796da0c37f5cbc9cf to your computer and use it in GitHub Desktop.
Save jmlavoier/e0a3bebb6ad647f796da0c37f5cbc9cf to your computer and use it in GitHub Desktop.
It's a dumb component
// 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