React Utility Types
Last updated
@types/react
comes with a few convenient utility types that I didn’t learn about until way too late.
This is like the Parameters<F>
utility type to extract the type of a components props.
Get the right mouse for a specific HTML element
_1type ButtonProps = React.MouseEventHandler<HTMLButtonElement>
Just adds { children: ReactNode }
to the given type.