Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const players = queryString.parse(this.props.location.search);
- api.battle([
- players.playerOneName,
- players.playerTwoName
- ]).then((players) => {
- if(players === null) {
- return this.setState(() => {
- return {
- error: 'Looks like there was an error. Check that both users exist',
- loading: false
- }
- });
- }
- this.setState(() => {
- return {
- error: null,
- winner: players[0],
- loser: players[1],
- loading: false
- }
- });
- }.bind(this)); // <-- This causes an error in both my editor and webpack
Add Comment
Please, Sign In to add comment