New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Miscellaneous polish #15665
[docs] Miscellaneous polish #15665
Conversation
4f6d770
to
b8208e8
Compare
No bundle size changes comparing 048c9ce...b8208e8 |
@@ -109,6 +109,10 @@ function ArrowTooltip(props: TooltipProps) { | |||
); | |||
} | |||
|
|||
ArrowTooltip.propTypes = { | |||
title: PropTypes.node, | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as any?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only "hide" them from the type checker if our propTypes are not as strict as the actual type definitions. Using propTypes with TypeScript requires an exact match e.g.
interface Props {
options: { checkMe: number }
}
function Component(props: Props) {}
// rejected
Component.propTypes = {
options: PropTypes.object.isRequired,
}
// passes
Component.propTypes = {
options: PropTypes.shape({ checkMe: PropTypes.number.isRequired }).isRequired,
}
In that case they match so no need for any
.
Main points: