To create a functional component in React with props in TypeScript, you can follow the below steps -
index.ts60 chars5 lines
index.ts182 chars11 lines
Note: Here, we are using the React.FC type. It stands for FunctionComponent which specifies that this component is a function and accepts props of type Props.
index.ts99 chars2 lines
Here, we are passing the values for title and description props.
That's it! Now you have created a functional component in React with props in TypeScript.
gistlibby LogSnag