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

Components["List"] expects the ref to be an HTMLDivElement in Typescript [BUG] #864

Open
allanRubenstein opened this issue Mar 16, 2023 · 1 comment
Labels
bug Something isn't working hacktoberfest This issue is suitable for the hacktoberfest ;)

Comments

@allanRubenstein
Copy link

Describe the bug
When using typescript and a custom List, Typescript throws an error and says it expects an HTMLDivElement when you try to pass the ref to anything else, for example an unordered list.

Reproduction
https://codesandbox.io/s/virtualized-custom-list-and-item-type-issue-g3irvh?file=/App.tsx:415-433

To Reproduce
Steps to reproduce the behavior:

  1. Create a component of type Components["List"] following the example on https://virtuoso.dev/customize-structure/
  2. Try and pass the ref to an element other than a div
  3. See error on the ref

Expected behavior
The ref is able to be passed to any html element.

Screenshots
Screenshot 2023-03-16 at 4 11 52 PM

@allanRubenstein allanRubenstein added the bug Something isn't working label Mar 16, 2023
@petyosi
Copy link
Owner

petyosi commented Mar 17, 2023

True, do you think you can send a PR for that? Worth doing so for the Items, too.

@petyosi petyosi added the hacktoberfest This issue is suitable for the hacktoberfest ;) label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest This issue is suitable for the hacktoberfest ;)
Projects
None yet
Development

No branches or pull requests

2 participants