Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const data = [
{
name: 'A',
description: 'This is a description of A',
parentId: '',
},
{
name: 'B',
description: 'This is a description of B',
parent: 'A',
},
{
name: 'M',
description: 'This is a description of M',
parent: 'A',
},
{
name: 'N',
description: 'This is a description of N',
parent: 'M',
},
{
name: 'C',
description: 'This is a description of C',
parent: 'A',
},
{
name: 'O',
description: 'This is a description of O',
parent: 'C',
},
{
name: 'D',
description: 'This is a description of D',
parent: 'A',
},
{
name: 'B-1',
description: 'This is a description of B-1',
parent: 'B',
},
{
name: 'B-2',
description: 'This is a description of B-2',
parent: 'B',
},
{
name: 'B-3',
description: 'This is a description of B-3',
parent: 'B',
},
{
name: 'K',
description: 'This is a description of K',
parent: 'B',
},
{
name: 'L',
description: 'This is a description of K',
parent: 'B',
},
{
name: 'X',
description: 'This is a description of X',
parentId: '',
},
{
name: 'Y',
description: 'This is a description of Y',
parentId: 'X',
},
{
name: 'Z',
description: 'This is a description of Z',
parentId: 'Y',
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment