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

[Bug]: FileUploaderButton's listFiles prop is forwarded to DOM element #9894

Closed
2 tasks done
imp-dance opened this issue Oct 19, 2021 · 2 comments · Fixed by #9915
Closed
2 tasks done

[Bug]: FileUploaderButton's listFiles prop is forwarded to DOM element #9894

imp-dance opened this issue Oct 19, 2021 · 2 comments · Fixed by #9915

Comments

@imp-dance
Copy link
Contributor

Package

carbon-components-react

Browser

Firefox

Package version

^10.27.0

Description

Adding listFiles={false} as a prop to the FileUploaderButton will result in ReactDOM throwing the following warning to console:

Warning: React does not recognize the 'listFiles' prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase 'listfiles' instead. If you accidentally passed it from a parent component, remove it from the DOM element.

CodeSandbox example

https://codesandbox.io/s/carbon-components-react-fileuploaderbutton-error-vq49z

Steps to reproduce

  1. Open linked CodeSandBox, or simply add a FileUploaderButton to your project with the listFiles prop set to false.
  2. Open devtools
  3. Take a look at console

Expected result: No errors/warnings in console
Actual result: ReactDOM outputs warning in console.

Code of Conduct

@imp-dance
Copy link
Contributor Author

Proposed solution: Before forwarding props to the DOM-element, remove the listFiles property.

@tay1orjones
Copy link
Member

tay1orjones commented Oct 20, 2021

Hey @imp-dance - sorry for the confusion here, it looks like listFiles should have been removed as a prop in v10 but was missed. It's not being used in any capacity and is just spread onto the label, which causes this error.

I'll put together a quick PR to remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants