Open kaiyoma opened 1 year ago
I believe this problem was introduced in 3.5.0 in this commit: https://github.com/react-component/virtual-list/commit/1ff9e16db54e2bdc03669c7cd330b8ed8bc60ee5
If I forcibly downgrade to version 3.4.13, the type error goes away.
Even though this package claims that it supports any React version in its peer dependencies, it's using a very new version of @types/react
, which works only with React 18. We're using React 17 in our project, so that's why we're seeing this error. Seems like either the version of @types/react
should be downgraded/reverted, or the peer dependencies should be updated to reflect reality.
It happen because this changed. https://github.com/DefinitelyTyped/DefinitelyTyped/commit/f1b25591890978a92c610ce575ea2ba2bbde6a89
I'm not sure if this can help but you might try to add this in your package.json
.
"resolutions": {
"@types/react": "^18.2.12"
}
Version 3.5.1 is throwing a type error from inside node_modules: