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

[styled-engine-sc] Fix missing @types/hoist-non-react-statics causing styled returns any #44397

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

megos
Copy link
Contributor

@megos megos commented Nov 13, 2024

I moved @types/hoist-non-react-statics from devDependencies to dependencies.

The type definitions for styled-engine-sc depend on hoist-non-react-statics.

import * as hoistNonReactStatics from 'hoist-non-react-statics';

The @types/hoist-non-react-statics is not included in the dependencies, if this type definition is not installed, styled would return any.

styled_returns_any

I tried this in Material UI + CRA + styled-components (TypeScript) repository.


I re-created this PR because the CI is stuck.
#43730 (comment)

@megos megos force-pushed the fix/styled-engine-sc-types-fix branch from c493fb9 to 1333ef8 Compare November 13, 2024 07:46
@mui-bot
Copy link

mui-bot commented Nov 13, 2024

Netlify deploy preview

https://deploy-preview-44397--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 779cf64

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Thanks again for the fix :)

@mnajdova mnajdova merged commit d74e950 into mui:master Nov 13, 2024
19 checks passed
@zannager zannager added the package: styled-engine-sc Specific to styled-components label Nov 13, 2024
@megos megos deleted the fix/styled-engine-sc-types-fix branch November 14, 2024 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: styled-engine-sc Specific to styled-components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants