Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Pokemon List HoC
var PokemonList = React.createClass({
propTypes: {
onSelect: React.PropTypes.func.isRequired,
selection: React.PropTypes.object.isRequired,
getInitialState() {
return {
pokemon: [],
fetchPokemon() {
// Hit API, get pokemon, and set to pokemon on state.
// Assume unsharable for... reasons.
renderPokemon() {
return {
<input type="checkbox" onClick={this.props.onSelect(pokemon)} checked={this.props.selection.has(pokemon)} />
render() {
return (
<th>"Favorite Attack"</th>
export default PokemonList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment