I am currently utilizing a dropdown list from the UI Framework Ant Design and I encountered an issue where I need to utilize useRef in order to control it, specifically to add or remove the Visible={true} attribute. However, TypeScript is throwing an error at me.
The error states: Type '{ children: Element; ref: MutableRefObject; className: string; overlay: Element; trigger: "click"[]; }' cannot be assigned to type 'IntrinsicAttributes & DropDownProps & { children? ReactNode; }'. The 'ref' property does not exist for the type 'IntrinsicAttributes & DropDownProps & { children? ReactNode; }'.
Displayed below are two screenshots showcasing the Dropdown Button element and the TS error encountered:
View the first screenshot here
View the second screenshot here
UPDATE**
As a temporary solution, my approach involves keeping the drop-down list open when on the home page, while it opens upon clicking on other pages. However, it would be preferable to have the ability to set or remove the attribute visible={true} through Ref. View the image description here
For those interested, you can access the source code via the following link: Source Code Link