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] Disable type-checking of .propTypes #24747

Merged
merged 3 commits into from Feb 3, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Feb 2, 2021

(Component as any).propTypes is not recognized by react-docgen.
Update: Considering the bundle size reduction it's probably also not recognized by babel-plugin-transform-react-remove-prop-types
Update: .propTypes were not removed before: https://unpkg.com/browse/@material-ui/lab@5.0.0-alpha.24/ClockPicker/ClockPicker

We can achieve sounder types with Component.propTypes = {} as any by adjusting the type of Component. .propTypes and Props types need to match exactly which breaks down when .propTypes need the actual runtime or we didn't resolve a big object (e.g. classes).

@eps1lon eps1lon added typescript core Infrastructure work going on behind the scenes labels Feb 2, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Feb 2, 2021

@material-ui/lab: parsed: -0.99% 😍, gzip: -0.61% 😍

Details of bundle changes

Generated by 🚫 dangerJS against d6d1cd9

@eps1lon eps1lon changed the title [types] Remove implicit children from PropInjector [core] Disable type-checking of .propTypes Feb 2, 2021
@eps1lon eps1lon force-pushed the core/disable-proptypes-checking branch from 40ef0db to d6d1cd9 Compare February 2, 2021 16:24
@eps1lon eps1lon marked this pull request as ready for review February 2, 2021 16:30
@eps1lon eps1lon merged commit 746b918 into mui:next Feb 3, 2021
@eps1lon eps1lon deleted the core/disable-proptypes-checking branch February 3, 2021 09:06
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.

None yet

2 participants