type Props = {
...
}
const Parent = ():JSX.Element => {
return {
// =================================================================================================== //
// ERROR: Type '{ props: Props | undefined; }' is not assignable to type 'IntrinsicAttributes & Props'.
// ERROR: Property 'props' does not exist on type 'IntrinsicAttributes & Props'.ts(2322)
// =================================================================================================== //
< Child props={props} />
}
}
const Child = (props: Props): JSX.Element => {
...
type Props = {
...
}
const Parent = ():JSX.Element => {
return {
< Child props={props} /> // Fixed
}
}
type ChildProps = {
props: Props
}
const Child = ({ props } : ChildProps): JSX.Element => {
...