Objects are not valid as a React child. Use an array instead or wrap the object using createFragment(object) from the React add-ons

I've an object structured like:

let a = {
    "a1" : ["test a1"],
    "a2": [
      {key:"test a2",id: 563},
      "test a3"

it gives the above the error. Actually it gives me an error on the structure I'm trying to render inside a component

          text: a.a2[0].key,
          id: a.a2[0].id

I'm rendering the data inside this comp


  data = {menuData}
  onSelection = {(element) => this.onSelectDashboardRule(element)}

The error says use array instead: so if I do:

a = {
    "a1" : ["test a1"],
    "a2": [
      "test d4,
      "test a3"

it works, so why its not able to recognize the object? Also anyone has idea what "object using createFragment(object)" would work? I dont quite understand what is expected, is the structure wrong?