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

[material-ui][ClickAwayListener] Fix export of types #40485

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

illume
Copy link
Contributor

@illume illume commented Jan 8, 2024

Removes a tailing comma so it is compatible with older supported TypeScript versions.

Fixes #38837

The benefit is mui v5 works with older supported TypeScript versions. Important when upgrading older projects from material-ui v4.

node_modules/@mui/material/ClickAwayListener/index.d.ts:1:45 - error TS1005: ',' expected.

1 export { ClickAwayListener as default, type ClickAwayListenerProps, } from '@mui/base/ClickAwayListener';
                                              ~~~~~~~~~~~~~~~~~~~~~~

Found 1 error.

Reproducer

You can reproduce the error using TypeScript 4.4.3.

cd examples/material-ui-cra-ts

# edit package.json so typescript dependency is 4.4.3

npm install

./node_modules/.bin/tsc --version
Version 4.4.3
./node_modules/.bin/tsc
node_modules/@mui/material/ClickAwayListener/index.d.ts:1:45 - error TS1005: ',' expected.

1 export { ClickAwayListener as default, type ClickAwayListenerProps, } from '@mui/base/ClickAwayListener';
                                              ~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

This is not compatible with older supported TypeScript versions.

Fixes mui#38837
@illume illume marked this pull request as draft January 8, 2024 15:39
@mui-bot
Copy link

mui-bot commented Jan 8, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 5a228c0

@illume illume marked this pull request as ready for review January 8, 2024 15:53
@zannager zannager added component: ClickAwayListener The React component package: material-ui Specific to @mui/material labels Jan 8, 2024
@zannager zannager requested a review from mnajdova January 8, 2024 17:11
@oliviertassinari oliviertassinari changed the title [material-ui][ClickAwayListener]: Fix trailing comma on type [material-ui][ClickAwayListener] Fix trailing comma on type Jan 8, 2024
@oliviertassinari oliviertassinari added typescript bug 🐛 Something doesn't work labels Jan 8, 2024
@oliviertassinari oliviertassinari changed the title [material-ui][ClickAwayListener] Fix trailing comma on type [material-ui][ClickAwayListener] Fix imports of types Jan 8, 2024
@oliviertassinari oliviertassinari changed the title [material-ui][ClickAwayListener] Fix imports of types [material-ui][ClickAwayListener] Fix export of types Jan 8, 2024
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Signed-off-by: Marija Najdova <mnajdova@gmail.com>
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 for the fix, I verified that it now works with TS 4.4.3.

@mnajdova mnajdova merged commit ea15582 into mui:master Jan 9, 2024
19 checks passed
@mnajdova mnajdova mentioned this pull request Jan 9, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: ClickAwayListener The React component package: material-ui Specific to @mui/material typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[base-ui] TypeScript error in Click Away Listener
5 participants