I use the included FC type from React for Functional Components:
importReact,{FC}from'react';// typing with the HTMLAttributes extensiontypeFunctionalCompType={id:string;// ..other stuff}&HTMLAttributes<HTMLButtonElement>constFunctionalComp:FC<FunctionalCompType>=props=>{const{children,id,...buttonProps}=props;return<button{...buttonProps}>{children}</button>
};
I use the included
FC
type from React for Functional Components:That's nice! I didn't know about it.
But actually, I use strict lint rules so I must define the function argument type and return type.