Skip to content
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

为什么只要使用任何组件都会出现下面这种报错呢? #352

Open
shangjian2022 opened this issue Apr 6, 2024 · 2 comments

Comments

@shangjian2022
Copy link

Uncaught runtime errors:
×
ERROR
Cannot read properties of null (reading 'useState')
TypeError: Cannot read properties of null (reading 'useState')
at useState (http://localhost:3000/static/js/bundle.js:32228:25)
at APILoader (http://localhost:3000/static/js/bundle.js:456:76)
at renderWithHooks (http://localhost:3000/static/js/bundle.js:53535:22)
at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:56819:17)
at beginWork (http://localhost:3000/static/js/bundle.js:58115:20)
at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:43131:18)
at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:43175:20)
at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:43232:35)
at beginWork$1 (http://localhost:3000/static/js/bundle.js:63096:11)
at performUnitOfWork (http://localhost:3000/static/js/bundle.js:62344:16)
ERROR
Cannot read properties of null (reading 'useState')
TypeError: Cannot read properties of null (reading 'useState')
at useState (http://localhost:3000/static/js/bundle.js:32228:25)
at APILoader (http://localhost:3000/static/js/bundle.js:456:76)
at renderWithHooks (http://localhost:3000/static/js/bundle.js:53535:22)
at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:56819:17)
at beginWork (http://localhost:3000/static/js/bundle.js:58115:20)
at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:43131:18)
at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:43175:20)
at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:43232:35)
at beginWork$1 (http://localhost:3000/static/js/bundle.js:63096:11)
at performUnitOfWork (http://localhost:3000/static/js/bundle.js:62344:16)
ERROR
Cannot read properties of null (reading 'useState')
TypeError: Cannot read properties of null (reading 'useState')
at useState (http://localhost:3000/static/js/bundle.js:32228:25)
at APILoader (http://localhost:3000/static/js/bundle.js:456:76)
at renderWithHooks (http://localhost:3000/static/js/bundle.js:53535:22)
at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:56819:17)
at beginWork (http://localhost:3000/static/js/bundle.js:58115:20)
at beginWork$1 (http://localhost:3000/static/js/bundle.js:63074:18)
at performUnitOfWork (http://localhost:3000/static/js/bundle.js:62344:16)
at workLoopSync (http://localhost:3000/static/js/bundle.js:62267:9)
at renderRootSync (http://localhost:3000/static/js/bundle.js:62240:11)
at recoverFromConcurrentError (http://localhost:3000/static/js/bundle.js:61732:24)

@shangjian2022
Copy link
Author

{
"name": "react-app",
"version": "0.1.0",
"homepage": ".",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@uiw/react-amap": "^6.0.3",
"antd": "^5.16.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"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"
]
}
}
这个环境
import React from 'react';
import ReactDOM from 'react-dom';
import { Map, APILoader } from '@uiw/react-amap';

const Demo = () => (

);

export default Demo;
这么个演示代码

@jaywcjlove
Copy link
Member

@shangjian2022 你可以提供一个可以重现错误的示例,我帮你看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants