I am struggling with accessing a nested prop object in React
I have a Header reusable component in which the props are className and title.
interface HeaderProps {
className: string;
title: ReactNode;
}
The usage of Header component is given below.
<Header className='my-header' title={<Title color='red'> title of the page </Title>} />
Now inside Header component I want to access color prop of Title component.
I was thinking to use props.title.props.color. But typescript throws error as
props is not assignable to "whole ReactNode Thing"