javascript - getting value and id from a React MaterialUI RadioButtonGroup -


i'm trying selected value , gameid dynamic materialui radiobuttongroup.

doing can gameid, not value:

<form onsubmit={this.handleemailnotifications}>     <ul>         {profile.games.map((game) => {             return (                 <li key={game.game_id}>                     <radiobuttongroup                         name={game.game_title}                         onchange={() => this.handlegamenewschange(event, value, game)}>                         <radiobutton                             value="yes"                             label="yes"                         />                         <radiobutton                             value="no"                             label="no"                         />                     </radiobuttongroup>                 </li>             )         })}     </ul> </form>   handlegamenewschange(event, value, game) {     console.log(event, value, game) }  //output undefinded, undefined, game 

changing

onchange={() => this.handlegamenewschange(event, value, game)} 

to

onchange={this.handlegamenewschange}> 

i can value not gameid

how can both?

because not passing event , value in arrow function, write this:

onchange={(event, value) => this.handlegamenewschange(event, value, game)}> 

that's why event , value undefined.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -