‘DatePicker‘ cannot be used as a JSX component.

问题: ‘DatePicker’ cannot be used as a JSX component.

网上查的 是antd和react在四月份升级后出现问题

解决办法

"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.5",
"antd": "4.21.2",
"typescript": "^4.1.2",

已解决问题,亲测有效

你可能感兴趣的:(javascript,typescript,前端)