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] Miscellaneous polish #15665

Merged
merged 8 commits into from May 12, 2019
Merged

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented May 11, 2019

Main points:

  • reduce usage of eslint-disable inside the demo source
  • prefer package import over path imports

@eps1lon eps1lon added the docs Improvements or additions to the documentation label May 11, 2019
@mui-pr-bot
Copy link

No bundle size changes comparing 048c9ce...b8208e8

Generated by 🚫 dangerJS against b8208e8

@@ -109,6 +109,10 @@ function ArrowTooltip(props: TooltipProps) {
);
}

ArrowTooltip.propTypes = {
title: PropTypes.node,
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as any?

Copy link
Member Author

@eps1lon eps1lon May 11, 2019

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.

@oliviertassinari oliviertassinari merged commit 3b78a39 into mui:next May 12, 2019
@eps1lon eps1lon deleted the docs/playroom-compat branch May 18, 2019 10:49
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants