I'm trying to pass the title
down to the child Modal component
<Modal title='Register'/>
const Modal
has the error
Type '(props: PropsWithChildren) => { props: PropsWithChildren; (Missing): any; }' is not assignable to type 'FunctionComponent'. Type '{ props: PropsWithChildren; (Missing): any; }' is missing the following properties from type 'ReactElement ReactElement Component)> | null) | (new (props: any) => Component)>': type, keyts(2322)
import React from 'react';
interface propsInterface {
title: string;
}
const Modal: React.FC<propsInterface> = (props) => {
return (
{props.title}
);
}
export {Modal};
return props.title
or wrap with div tag like thisreturn <div>{props.title}</div>
– kyunreturn <>{props.title}</>
– ravibagul91