Last active
October 16, 2016 04:29
-
-
Save chaintng/6e66a5f46a227861e4e3f04f37ed63c5 to your computer and use it in GitHub Desktop.
react-step-2-2.jsx
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
var Filter = React.createClass({ | |
propTypes: { // 1) assign expected parameter type | |
onFilterPokemonAtkChange: React.PropTypes.func, | |
onFilterPokemonTypeChange: React.PropTypes.func, | |
}, | |
render: function() { | |
return (<div id="filterBar"> | |
<label>Select Pokemon Type: </label> | |
<select name="type" id="pokemonTypeFilter" onChange={this.props.onFilterPokemonTypeChange}> {/* 2) assign event listener function for pokemon filter */} | |
<option value="">- ALL -</option> | |
<option value="grass">grass</option> | |
<option value="fire">fire</option> | |
{/* ... */} | |
</select> | |
<label>Input Minimum Attack: </label><input type="text" id="pokemonAtkFilter" onChange={this.props.onFilterPokemonAtkChange} /> {/* 2) assign event listener function for pokemon atk */} | |
</div>); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment