React FC or React Functional Components

The functional components were called as Stateless Function Components before the introduction of Hooks. In React Hooks were introduced in React v16.8. Hooks gives you the ability to extract state and the lifecycle into your functions. It has the potential to replace class components in the future. If you just extend the React.Component using TypeScript with React class components comes easy. To implement the functions just type React.FuctionComponent or React.FC.

import * as React from 'react'                                                        

 

interface IProps {

  // ... props interface

}

 

// NEW syntax for typing function components

const MyNewComponent: React.FC<IProps> = (props) =>{...};

                                                 

// OLD syntax for typing function components

const MyOldComponent: React.SFC<IProps> = (props) => {...};

The React.FC assures the signature of our function is correct and return value is a valid JSX. React TypeScripts allows us to handle children, default Props.