The component is a breadcrumb, it must receive as props an object that contains a title and an url and also an option children node. The maximum depth should be 5, in this case this is a props example:
myProps = {
title: "level 1",
url: "/",
children: {
title: "level 2"
url: "/level2"
children: {
title: "level 3"
url: "level2/level3"
children: {
title: "level 4"
url: "level2/level3/level4"
children: {
title: "level 5"
url: "/level2/level3/level4/level5"
}
}
}
}
};
But it can also have less nesting, for example:
myProps = {
title: "title1"
url: "/"
children: null
}
How should the interface look like?
Is this correct?
export interface MyProps {
title: string;
url: string;
children: MyProps;
}