SHARE
TWEET

Untitled

a guest Jun 19th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. playerList: {
  2.             player: [
  3.                 {
  4.                     playerAlias: [
  5.                         {
  6.                             name: null
  7.                         }
  8.                     ],
  9.                     idPlayer: null,
  10.                     playerName: null,
  11.                     broadcastChannel: null,
  12.                     clusterName: null
  13.                 }
  14.             ]
  15.         }
  16.  
  17.     }
  18.      
  19. insertAliasToList = () => {
  20.     let insertedAlias = {
  21.         name: this.state.newAlias
  22.     }
  23.  
  24.     this.setState(prevState => ({
  25.         ...prevState,
  26.         playerList: {
  27.             ...prevState.playerList,
  28.             player: {
  29.                 ...prevState.playerList.player,
  30.  
  31.  
  32.                 playerAlias: [...prevState.playerList.player.playerAlias, insertedAlias]
  33.  
  34.  
  35.             }
  36.         }
  37.     }))
  38.  
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top