You can create a stateless React component in TypeScript as easily as creating a function.
But if you want to create high quality idiomatic React + TypeScript components we cover some improved patterns in this lesson.
React.SFC is deprecated
now.
Use : https://github.com/basarat/react-typescript/blob/master/src/app/app.tsx
Can we create a type like
type someProps = { compiler: string, framework: string }
const App: React.FC<someProps> = (props) => { return ( <div> <div>{props.compiler}</div> <div>{props.framework}</div> </div> ); }
Yes Sarmad:
type SomeProps = { compiler: string, framework: string }
const App: React.FC<SomeProps> = (props) => {
return (
<div>
<div>{props.compiler}</div>
<div>{props.framework}</div>
</div>
);
}