When creating buttons for each item in an array in React, how do I pass in unique onClick parameters based on the array value?

Keywords´╝Ü javascript reactjs


I am creating a button for each string an an array (ie. majorDivisions = ["upper", "lower"]). I need each button to have an onClick function with parameters equal to the unique value (ie. "upper" or "lower") depending on which value was used to create the button. It is creating the correct buttons but for when calling the function, the parameter is not the string but instead some class object.

    {this.state.majorDivisions.map((division) => {
      return <button onClick = {this.renderDivisionRequirements.bind(null, {division})}>{division}</button>

My code is successfully creating 2 buttons [lower] and [upper], however the onClick parameter {division} is appearing as a class object.