React rendering nested json

Viewed 8874

I have some json looking like this

[
    {
    "name": "Hello Kitty",
    "items": [
        {
        "name": "Kitty Muu Muu"
      },
      {
        "name": "Kitty smack"
      }
    ]
  },
  {
    "name": "Hello Pussy",
    "items": [
            {
        "name": "World",
        "items": [
            {
            "name": "Hello Pussy world"
          }
        ]
      }
    ]
  }
]

it's nested JSON and my question is; where should the recursiveness be handled to render this?

I have 2 components List component that calls the data and posts data changes back to the server

Item component that renders a single item

Should I handle this at the list level or item level?

The item renders an input field you can update and this should be possible both at parent and child level

2 Answers
Related