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

FileInput - failed prop type of removeIcon #9595

Closed
PawelSuwinski opened this issue Jan 19, 2024 · 1 comment · Fixed by #9596
Closed

FileInput - failed prop type of removeIcon #9595

PawelSuwinski opened this issue Jan 19, 2024 · 1 comment · Fixed by #9596

Comments

@PawelSuwinski
Copy link

Using custom removeIcon in FileInput triggers such warning on the console:

Warning: Failed prop type: Invalid prop removeIcon of type object supplied to FileInputPreview, expected a single ReactElement.

ex.

import CloseIcon from "@mui/icons-material/Close";
(...)
     <FileInput removeIcon={CloseIcon} />

Steps to reproduce:

https://stackblitz.com/edit/github-qjhrzz?file=src%2Fposts%2FPostCreate.tsx

  1. Use project preview and open Console at Developers Tools
  2. Add a file (PDF-Template)

It looks like a wrong prop type:

Shouldn't be?

FileInputPreview.propTypes = {
   (...)
    removeIcon: PropTypes.elementType,
}
@djhi
Copy link
Contributor

djhi commented Jan 19, 2024

Indeed, thanks for the report!

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