Make React prop depends to other props
The context
We have a Menu component that can have as children MenuItem or a custom react component.
Let's say the signature of MenuItem is like this :
// MenuItem.tsx
export type MenuItemProps = {
... // some props
label: string
}
export const ...
tawaliou.com4 min read