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] Warning about non-boolean attribute 'button' #22941

Closed
crankeith opened this issue Oct 8, 2020 · 6 comments
Closed

[ListItem] Warning about non-boolean attribute 'button' #22941

crankeith opened this issue Oct 8, 2020 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@crankeith
Copy link

crankeith commented Oct 8, 2020

Current Behavior 😯

Getting following warning about "button" prop on ListItem component:
Warning: Received true for a non-boolean attribute button.

Expected Behavior 🤔

The prop "button" should be allowed without warning

Steps to Reproduce 🕹

Render the "ListItem" component with the "button" prop declared:
<ListItem button />
or
<ListItem button={true} />

Your Environment 🌎

Tech Version
Material-UI v4.11.0
React v16.13.1
Browser Google Chrome 85.0.4183.121
@crankeith crankeith added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 8, 2020
@oliviertassinari oliviertassinari added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 8, 2020
@ayush505
Copy link

ayush505 commented Oct 8, 2020

Assign this to me

@eps1lon
Copy link
Member

eps1lon commented Oct 8, 2020

It doesn't look like this bug report has enough info for one of us to reproduce it.

Please provide a CodeSandbox (https://material-ui.com/r/issue-template), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.

Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

@Apollinaire
Copy link

This looks like it's linked with an issue I have in a TS environment;
Basically, you can't spread a ListItemProps typed object inside ListItem without having the following error:

Type 'boolean' is not assignable to type 'true'.ts(2769)

Reproduction : https://codesandbox.io/s/material-ui-issue-forked-w5cew?file=/src/Demo.tsx

@Apollinaire
Copy link

After looking more into it, this seems related to #14971 , since the propTypes are generated from the TS types

@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists and removed status: waiting for author Issue with insufficient information labels Nov 2, 2020
@oliviertassinari
Copy link
Member

Duplicate of #14971

@oliviertassinari oliviertassinari marked this as a duplicate of #14971 Nov 2, 2020
@irtaza1997
Copy link

I was also getting this warning but then I just changed the props from button={true} to button="true", and then there is no warning from DOM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

6 participants