Below is an interface with a constant that inherits it:
interface TreeNode {
name: string;
children?: TreeNode[];
}
const TREE_DATA: TreeNode[] = [
{
name: 'Mes services',
}, {
name: 'Logiciels externes',
children: [
{ name: 'Facturation' },
{ name: 'Add-on' },
]
}, {
name: "Collecteurs d'espace client",
children: [
{ name: 'Banques' },
{ name: 'Fournisseurs' },
]
}, {
name: 'Services partenaires',
children: [
{ name: 'Avocats' },
]
}
];
I want to identify the array with the Collecteurs d'espace client
name attribute and then include a new TreeNode
in its children
array.