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

ListItem button prop can not accept boolean type in typescript #27011

Closed
2 tasks done
jindong-zhang-git opened this issue Jun 29, 2021 · 1 comment
Closed
2 tasks done
Labels
breaking change component: list This is the name of the generic UI component, not the React module! v5.x migration

Comments

@jindong-zhang-git
Copy link

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

My code looks like:

items.map(item => (
    <ListItem button={item.children.length > 0}>
        ...
    </ListItem>
  ))

But having error like this:

TS2769: No overload matches this call.
   The last overload gave the following error.
     Type 'boolean' is not assignable to type 'true'. 

Expected Behavior 🤔

would like to use a boolean variable here, thanks

@jindong-zhang-git jindong-zhang-git added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 29, 2021
@mnajdova
Copy link
Member

Note that we introduced the ListItemButton component with #26446. You should use this component now and swap when needed.

@mnajdova mnajdova added breaking change component: list This is the name of the generic UI component, not the React module! v5.x migration and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: list This is the name of the generic UI component, not the React module! v5.x migration
Projects
None yet
Development

No branches or pull requests

2 participants