Skip to content

fix(tabs): onChange callback type definition #2193

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

Conversation

tomoto-hitachi
Copy link
Contributor

Hi all, this is a minor type definition fix of HvTabsProps.onChange.

Issue

You get this error when passing onChange handler to HvTabs.
image

Analysis

It appears an issue of MUI 4, which they admit but will not fix as they are now focusing on MUI 5.
mui/material-ui#17454

Solution

Based on the discussion in the thread above, explicitly declaring onChange handler with the event type React.SyntheticEvent (parent class of ChangeEvent, FormEvent, etc.) can workaround the issue.

@tomoto-hitachi tomoto-hitachi force-pushed the fix/tabs-type-definition branch from f2664de to e8fc35b Compare December 17, 2020 07:10
@github-actions github-actions bot temporarily deployed to uikit/pr-2193 December 17, 2020 07:14 Inactive
@github-actions github-actions bot temporarily deployed to uikit/pr-2193 December 17, 2020 07:17 Inactive
@francisco-guilherme francisco-guilherme merged commit 3b10001 into lumada-design:master Dec 17, 2020
@tomoto-hitachi tomoto-hitachi deleted the fix/tabs-type-definition branch December 18, 2020 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants