Skip to content
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

Merged

Conversation

oliviertassinari
Copy link
Member

Done to help make the case for: #22315.

@oliviertassinari oliviertassinari changed the title [docs] Migrate templates to TypeScript [docs] Migrate all templates to TypeScript Sep 19, 2020
@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation typescript labels Sep 19, 2020
Comment on lines -27 to -30
renderRow.propTypes = {
index: PropTypes.number.isRequired,
style: PropTypes.object.isRequired,
};
Copy link
Member Author

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',
Copy link
Member Author

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}
Copy link
Member Author

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}>
Copy link
Member Author

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.

@mui-pr-bot
Copy link

Details of bundle changes

Generated by 🚫 dangerJS against be583b5

@oliviertassinari oliviertassinari merged commit eebcc92 into mui:next Sep 21, 2020
@oliviertassinari oliviertassinari deleted the migrate-templates-typescript branch September 21, 2020 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants