I have been working in a react typescript project for awhile and the way that we had been type-checking props was with the React.FC generic. Going into the react typescript documentation I find code like the following:
interface DateProps {
iso8601Date: string;
message: string;
}
const DateComponent: FauxactFunctionComponent<DateProps> = props => (
<time dateTime={props.iso8601Date}>{props.message}</time>
);
However I just started a new project and there have been a few updates and we updated the eslint to the recommended for react. The new eslint rules are throwing the error:
"missing in props validation eslintreact/prop-types"
This can easily be avoided by following changing some linting rules recommended here:
"rules": {
"react/prop-types": "off"
}
I am tempted to turn off this linting rule and do it as we have done in the past. I don't think I see any added benefit from the docs. But am asking if there is something I am missing with the use of prop-types and why might it be better than the original method? I am leaning towards turning it off.