Skip to content

Instantly share code, notes, and snippets.

@chitru
Created February 5, 2020 11:00
Show Gist options
  • Select an option

  • Save chitru/f2b68a6123ef02e65a04d28b34251820 to your computer and use it in GitHub Desktop.

Select an option

Save chitru/f2b68a6123ef02e65a04d28b34251820 to your computer and use it in GitHub Desktop.
MultiStepFrom
import React from "react";
const states = [
["NSW", "New South Wales"],
["VIC", "Victoria"],
["WA", "Western Australia"]
];
const StateDrop = ({ label, ...others }) => (
<>
<label>{label}</label>
<select {...others}>
{states.map(([value, name]) => (
<option value={value}>{name}</option>
))}
</select>
</>
);
export default StateDrop;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment