score:3

Accepted answer

yearsvalue is a string and therefore using json.stringify won't help you.

also, render method must return something:

constructor (props) {
  super(props);
  this.state = {
    selectvalue: '',
    yearsvalue: [],
    months:''
  }

  this.setdatagroup = this.setdatagroup.bind(this);
}
... 
render() {
  const { yearsvalue } = this.state

  return (
    <div>
      {yearsvalue.map((item, index) =>
        <div key={index}>{item.data}:{item.value}</div>
      )}
    </div>
  }
}

score:2

your data is in correct format. initialize yearsvalue as array in constructor like

this.state = {
  yearsvalue: []
}

and then you can use yearsvalue state in render like below

render() {
  return (
     <div>
       {this.state.yearsvalue.map((d, index) => {
          return (
             <div key={index}>{d.data}</div>
          )
       })}
     </div>
  )
}

Related Query

More Query from same tag