React - reproduce dropdown
Starting point for creating JSFiddles with React. This uses React with Addons.
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js"></script>
<script src="https://fb.me/react-with-addons-0.14.6.js"></script>
<script src="https://fb.me/react-dom-0.14.6.js"></script>
<script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"></script>
<select>
<option>Apple</option>
<option>Orange</option>
<option>Pear</option>
<option>Peach</option>
</select>
<h1>
Reproduce the functionality of the above browser native dropdown in react
</h1>
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
CSS
select {
margin: 20px;
}
JavaScript 1.7
var Hello = React.createClass({
render: function() {
return <div > Hello {
this.props.name
} < /div>;
}
});
ReactDOM.render( <Hello name="World" /> ,
document.getElementById('container')
);