1. 3
    Create stateless React components using TypeScript
    1m 37s

Create stateless React components using TypeScript

Share this video with your friends

Send Tweet

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.

Angshuman Agarwal
~ 5 years ago

React.SFC is deprecated now. Use : https://github.com/basarat/react-typescript/blob/master/src/app/app.tsx

Sarmad ajaz
~ 4 years ago

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> ); }

Basarat Ali Syedinstructor
~ 4 years ago

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>
  );
}