Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement