-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
'AutoSizer' cannot be used as a JSX component #1739
Comments
I believe this is caused by an incompatible version of |
🤔. I'll try to reproduce it in a sandbox tonight. |
facing the exact same issue |
Ran into the same issue and solved it with this method. Using Thus I had to add
to my composer.json and run |
Thanks a lot @tippfelher! It solved the issue perfectly. |
By downgrading @types/react version worked for me "dependencies": { |
Is there a similar solution for npm users? |
Seems like this can be solved |
This shouldn't be happening and this issue shouldn't be closed. |
Is there a way we can enjoy a new version compatible with the new react versions 17 18.... React-virtualized awesome but it is not touched for more than two years : / |
This case needs re-opening |
While working with a turbo repo, none of the suggestions above worked for me. I had to type cast import {
AutoSizer as _AutoSizer,
List as _List,
ListProps,
AutoSizerProps,
} from "react-virtualized";
const List = _List as unknown as FC<ListProps>;
const AutoSizer = _AutoSizer as unknown as FC<AutoSizerProps>; |
This solved the issue for me without the need to downgrade React. |
I can't thank you enough. Fought with this issue for two days and downgrading React because of just one library felt like a red flag. |
Thanks a lot. This should be fixed, isn't the library updated anymore? |
import { FC } from 'react';
import {
AutoSizer as _AutoSizer,
List as _List,
InfiniteLoader as _InfiniteLoader,
ListProps,
AutoSizerProps,
InfiniteLoaderProps,
} from 'react-virtualized';
export const VirtualizedList = _List as unknown as FC<ListProps> & _List;
// You need this one if you'd want to get the list ref to operate it outside React 👍
export type VirtualizedListType = typeof VirtualizedList;
export const AutoSizer = _AutoSizer as unknown as FC<AutoSizerProps> & _AutoSizer;
export const InfiniteLoader = _InfiniteLoader as unknown as FC<InfiniteLoaderProps> & _InfiniteLoader; |
Hi, i still have this issue, why is it closed? |
…d them with this (see link): bvaughn/react-virtualized#1739
Please reopen this |
running yarn dedupe fixed this for me |
Hello team! I'd like to request some help, I am facing an issue in typescript, check it out:
Bug Report
Repo:
https://github.com/mbagatini/05-performance
Component:
src/components/SearchResultsVirtualized.tsx
What is the current behavior?
I'm getting the error "'AutoSizer' cannot be used as a JSX component." The same happens with List.
If you need more details, please let me know.
What is the expected behavior?
To solve the errors that are happening.
Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?
The text was updated successfully, but these errors were encountered: