使用了pro antd,一直
报错Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
检查了react版本
"@types/react": "^17.0.1",
"@types/react-dom": "^17.0.1",
"antd": "^4.24.12",
"react": "^17.0.1",
"react-dom": "^17.0.1",
发现@types/react版本使用有问题
最后将其升级为
"@types/react": "^18.0.25",
得以解决