virtual icon indicating copy to clipboard operation
virtual copied to clipboard

Hook interface does not expose measureSize option

Open gmltA opened this issue 3 years ago • 2 comments

Describe the bug

There's currently no possibility to override measureSize function in useVirtual hook options object in TypeScript.

According to library sources, the hook expects measureSize as an argument and handles it properly.

https://github.com/TanStack/virtual/blob/5300e47ea5ea4084b3a54a0fcd679c8a9653f131/src/index.js#L42

But this is not reflected in library typings.

Expected behavior

Types to be consistent with actual implementation.

tanstack-virtual version

2.10.4

Terms & Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

gmltA avatar Jul 26 '22 08:07 gmltA

Please try 3.0 beta and let me know if the issue persists. On Jul 26, 2022, 2:46 AM -0600, Alex Avetsiuk @.***>, wrote:

Describe the bug There's currently no possibility to override measureSize function in useVirtual hook options object. According to library sources, the hook expects measureSize as an argument and handles it properly. https://github.com/TanStack/virtual/blob/5300e47ea5ea4084b3a54a0fcd679c8a9653f131/src/index.js#L42 But this is not reflected in library typings. Your minimal, reproducible example none Steps to reproduce

  1. Compare typings with the implementation.

Expected behavior Types to be consistent with actual implementation. How often does this bug happen? Every time Screenshots or Videos No response Platform Any platform tanstack-virtual version 2.10.4 TypeScript version No response Additional context No response Terms & Code of Conduct

• I agree to follow this project's Code of Conduct • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

tannerlinsley avatar Jul 26 '22 13:07 tannerlinsley

@tannerlinsley I saw that there is an interface in v3 for this, but since it is still in beta, it makes sense to support currently stable version, isn't it?

gmltA avatar Jul 26 '22 16:07 gmltA

3.0 is the answer. Please upgrade.

tannerlinsley avatar Aug 29 '23 19:08 tannerlinsley