Created
April 18, 2018 10:46
-
-
Save chanakaDe/d839c1e20e7ae018c2d6ea8669646da1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import React, { Component } from 'react'; | |
class Planet extends Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
let planets = this.props.planets; | |
console.log("check data : ", planets); | |
let optionItems = planets.map((planet) => | |
<option key={planet.name}>{planet.name}</option> | |
); | |
return ( | |
<div className="row"> | |
<h4>demo output</h4> | |
<button className="btn">name</button> | |
<select> | |
<option value="volvo">Volvo</option> | |
<option value="saab">Saab</option> | |
<option value="mercedes">Mercedes</option> | |
<option value="audi">Audi</option> | |
</select> | |
<select className="form-control"> | |
<option value="name">Name</option> | |
{optionItems} | |
</select> | |
</div> | |
) | |
} | |
} | |
export default Planet; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment