Open Vadorequest opened 3 years ago
Alternative: VoidFunctionComponent
from React.
Example:
type Props = {
children: React.ReactElement | string;
containerStyle?: CSSStyles;
} & Partial<TooltipProps>;
const HelpTooltip: VoidFunctionComponent<Props> = (props): JSX.Element => {
...
}
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L549
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34237#issuecomment-585816352
See https://github.com/facebook/create-react-app/pull/8177
All components use React.FC in NRN, I liked it because it made explicit the component were functional, but it has a few drawbacks.
Planning on changing that for all components.