Skip to content

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

Merged
mnajdova merged 2 commits intomui:masterfrom
megos:fix/styled-engine-sc-types-fix
Nov 13, 2024
Merged

[styled-engine-sc] Fix missing @types/hoist-non-react-statics causing styled returns any#44397
mnajdova merged 2 commits intomui:masterfrom
megos:fix/styled-engine-sc-types-fix

Conversation

@megos
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
@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