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

[core] Add explicit type annotations to components #705

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

michaldudak
Copy link
Member

Components defined as functions (i.e. without forwardRef) with added propTypes ends up having an unexpected type in resulting .d.ts (as described in #651). This also causes #622.
Adding an explicit type annotation solves both of these problems.

Closes #622
Closes #651

@michaldudak michaldudak added core Infrastructure work going on behind the scenes typescript labels Oct 4, 2024
@mui-bot
Copy link

mui-bot commented Oct 4, 2024

Netlify deploy preview

https://deploy-preview-705--base-ui.netlify.app/

Generated by 🚫 dangerJS against 2acf3e5

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 7, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 7, 2024
Copy link
Contributor

@atomiks atomiks left a comment

Choose a reason for hiding this comment

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

Isn't typing props directly now redundant since it's typed with React.FC now?

@michaldudak
Copy link
Member Author

Yup, I just removed them.

@michaldudak michaldudak enabled auto-merge (squash) October 10, 2024 07:42
@michaldudak michaldudak merged commit bde120f into mui:master Oct 10, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up Component.propTypes: any from the types [core] TypeScript accepts arbitrary props on Root parts
3 participants