编译报错,求问
#450
Replies: 1 comment
-
@466849270 Your current application's react version does not meet X design dependency, please upgrade your react version. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
以下代码:
const App = () => {
return (
<Welcome
variant="borderless"
icon="https://mdn.alipayobjects.com/huamei_iwk9zp/afts/img/A*s5sNRo5LjfQAAAAAAAAAAAAADgCCAQ/fmt.webp"
title="Hello, I'm Ant Design X"
description="Base on Ant Design, AGI product interface solution, create a better intelligent vision~"
extra={
<Button icon={} />
<Button icon={} />
}
/>
);
};
export default App;
在npm run start时,报错信息如下:
react.development.js:1460 Uncaught TypeError: Cannot read properties of undefined (reading '$$typeof')
at exports.useContext (react.development.js:1460:1)
at useInternalToken (useToken.js:69:1)
at useToken (genStyleUtils.js:20:1)
at genStyleUtils.js:118:1
at genStyleUtils.js:49:1
at Welcome (index.js:35:1)
at react-stack-bottom-frame (react-dom-client.development.js:22428:1)
at renderWithHooks (react-dom-client.development.js:5757:1)
at updateForwardRef (react-dom-client.development.js:7762:1)
at beginWork (react-dom-client.development.js:10014:1)
安装的包依赖如下:
{
"name": "antdx-demo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/x": "^1.0.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.123",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"antd": "^5.16.5",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-scripts": "5.0.1",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Beta Was this translation helpful? Give feedback.
All reactions