Theme

Convert React Components

React Function Component

React Component without Props

  • <Footer />: rename footer.jsx to footer.tsx
footer.tsx
const Footer = () => <footer>Malcolm Kee &copy;</footer>;

render(<Footer />);

React Component with Props

  • <Spinner />

Using React.ReactNode

  • <Jumbotron />
  • <Navbar />

Using Union Types for props

  • <Alert />

Using JSX.IntrinsicElements

  • <Table />
  • <PanelBody />, <PanelFooter />, <PanelHeading />

Typing React.forwardRef

  • <Button />

React Class Component

  • <ErrorBoundary />

React Context

  • <FieldContext />