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] Migrate all templates to TypeScript #22650
[docs] Migrate all templates to TypeScript #22650
Conversation
renderRow.propTypes = { | ||
index: PropTypes.number.isRequired, | ||
style: PropTypes.object.isRequired, | ||
}; |
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.
This is a render function, no propTypes should be added. See the diff in packages/typescript-to-proptypes/src/parser.ts
. I think that it makes a great test case. I have work on this because the parsing on docs/src/pages/getting-started/templates/checkout/Checkout.tsx
was failing. The issue in checkout is unrelated but instead of fixing it, I went on solving one with more benefits :).
@@ -40,7 +40,7 @@ const mainFeaturedPost = { | |||
description: | |||
"Multiple lines of text that form the lede, informing new readers quickly and efficiently about what's most interesting in this post's contents.", | |||
image: 'https://source.unsplash.com/random', | |||
imgText: 'main image description', | |||
imageText: 'main image description', |
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.
Thank you TypeScript for spotting this mistake.
@@ -49,7 +49,7 @@ export default function FeaturedPost(props) { | |||
<CardMedia | |||
className={classes.cardMedia} | |||
image={post.image} | |||
title={post.imageTitle} | |||
title={post.imageText} |
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.
Thank you TypeScript for spotting this mistake.
<Typography variant="h6" gutterBottom className={classes.sidebarSection}> | ||
Social | ||
</Typography> | ||
{social.map((network) => ( | ||
<Link display="block" variant="body1" href="#" key={network}> | ||
<Link display="block" variant="body1" href="#" key={network.name}> |
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.
Thank you TypeScript for spotting this mistake.
Done to help make the case for: #22315.