I am trying to pass a prop of type string to a functional component defined in the same file and it is throwing the error:
TS2322: Type '{ text: string; }' is not assignable to type 'string'
.
I have been trying different syntaxes, but the error comes out to be the same.
const CircleText = (text: string): JSX.Element => (
<p>{text}</p>
)
export default function Login(): JSX.Element {
return (
<div>
<h1>Login</h1>
<CircleText text="testing"/>
</div>
);
}