Last active
April 17, 2018 07:51
-
-
Save hpstuff/3335d61e828c483d879bb720453b2f5c to your computer and use it in GitHub Desktop.
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
<CompareWrapper> | |
{this.renderPlayers} | |
</CompareWrapper> | |
renderPlayers(playerIDs, addPlayer) { | |
return playerIDs.map((playerID) => | |
<PlayerWrapper id={playerID}> | |
{(player) => this.renderPlayer(player, addPlayer)} | |
</PlayerWrapper> | |
) | |
} | |
renderPlayer({name, picture}, addPlayer) { | |
return ( | |
<Player name={name} picture={picture}> | |
<Button onPress={() => addPlayer(otherPlayerId)}></Button> | |
<Table>{/*(...)*/}</Table> | |
</Player> | |
); | |
} |
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
<CompareWrapper> | |
{(playerIDs, addPlayer) => | |
playerIDs.map((playerID) => | |
<PlayerWrapper id={playerID}> | |
{({name, picture}) => | |
<Player name={name} picture={picture}> | |
<Button onPress={() => addPlayer(otherPlayerId)}></Button> | |
<Table>{/*(...)*/}</Table> | |
</Player>} | |
</PlayerWrapper> | |
) | |
} | |
</CompareWrapper> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment