1

I'm encountering an issue while using the @tanstack/react-virtual library in my React project. According to the documentation, I should be able to import and use the useVirtualizer function from this module. However, when I try to import it as shown below:

import { useVirtualizer } from "@tanstack/react-virtual";

I receive the following error message:

"'@tanstack/react-virtual' has no exported member named 'useVirtualizer'. Did you mean 'useVirtual'?"

It seems that the useVirtualizer function is not being recognized as an exported member of the module. I have double-checked the documentation and my code, and everything seems to be in order. Could someone help me understand why I'm encountering this error and how I can resolve it?

React version: 18.2 Node.js version: 20.3 Tanstack/react-virtual: 3.0.0-alpha.0

import { useVirtualizer } from "@tanstack/react-virtual";

I expected this import statement to work without any issues and for me to be able to use the useVirtualizer function in my React component. However, instead of the expected behavior, I encountered the following error message:

"'@tanstack/react-virtual' has no exported member named 'useVirtualizer'. Did you mean 'useVirtual'?"

0 Answers0