Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ScrollView horizontal={true} showsHorizontalScrollIndicator={false}>
- <Tag onChange={() => this.handleAbility('Hell')} style={{ marginRight: 7 }}> Hell </Tag>
- {this.state.abilities.map(function (ability) {
- return <Tag onChange={() =>this.handleAbility(ability.label)} style={{ marginRight: 7 }}> {ability.label} </Tag>
- })}
- </ScrollView>
- handleAbility = (label) => {
- let character = Object.assign({}, this.state.character);
- if (character.abilities.indexOf(label) == -1) {
- character.abilities.push(label);
- this.setState({ character });
- } else {
- character.abilities.pop();
- this.setState({ character });
- }
- }
Add Comment
Please, Sign In to add comment