I have written a React component in TypeScript like this:
const SingleColumn = (image: any, heading: string, para: string) => {return(
<Col className="col-md-4 my-4">
<img src={image} alt="" className="w-100"/>
<h4 className="my-4">{heading}</h4>
<p>{para}</p>
<a href="#" className="btn btn-outline-dark btn-md">Our Story</a>
</Col>
)};
And I am calling this component in my code like this:
import img from '../img/1.jpg';
<Row className="row my-5">
<SingleColumn image={img1} heading="Amazing.Incredible." para="Use the adjective amazing"/>
</Row>
I have two problems with this code.
- The type of the image parameter is
any. What should be the right type? How do you find the right type of an HTML element? Is there a way to query it? - I am getting a compilation error saying
Tag 'SingleColumn' expects at least '3' arguments, but the JSX factory 'React.createElement' provides at most '2'.