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

Tabe filterIcon does not work #44351

Closed
rustam-as opened this issue Aug 22, 2023 · 4 comments · Fixed by #44357
Closed

Tabe filterIcon does not work #44351

rustam-as opened this issue Aug 22, 2023 · 4 comments · Fixed by #44357
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 👷🏻‍♂️ Someone working on it

Comments

@rustam-as
Copy link

Reproduction link

https://codepen.io/rustam-as/pen/qBLELZx?editors=1111

Steps to reproduce

created react app with vite and npx
added antd table to my app.jsx
in columns array there is filterIcon for add custom filter and onlick func

What is expected?

I expect when i click filter icon it consoles some string

What is actually happening?

it throws error "Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Environment Info
antd 5.8.4
React react@18.2.0
System Windows 11 pro 64bit (10.0 Build 22000)
Browser Google Chrome Version 110.0.5481.77 (Official Build) (64-bit)
@MadCcc
Copy link
Member

MadCcc commented Aug 22, 2023

https://codesandbox.io/s/shai-xuan-he-pai-xu-antd-5-8-4-forked-mfz35y?file=/demo.tsx
Would this solve your problem?

You should give valid filterDropdown or filters to make it work.

@rustam-as
Copy link
Author

rustam-as commented Aug 22, 2023

@MadCcc no, i need open a modal on filterIcon click.

@NihadMammadli03
Copy link

@MadCcc, good afternoon, the issue is still there, we tried with different versions of "andt" (5.3.2, 5.6.1, 5.8.4) and with different versions of "react". At first we tried it in a project created using yarn/vitejs, however, it is not an issue, because we also tried to use it a CRA and npm projects too. We also used different PC's. The issue still remains, it is impossible to use the filterIcon, as it gives the following error
"Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.". and the suggested solution is not useful, as without filterDropdown we can't change the filter Icon. filterDropdown: true is needed for putting and changing filterIcon.
It is a new bug, in projects that was created weeks ago the filterIcon can be changed.

@MadCcc
Copy link
Member

MadCcc commented Aug 22, 2023

Seems it's a issue caused by #43002 , which make filterDropdown support ref.

Should take this scenario into consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 👷🏻‍♂️ Someone working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants