{"id":4772,"date":"2023-01-04T18:18:06","date_gmt":"2023-01-04T10:18:06","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=4772"},"modified":"2023-01-04T18:18:06","modified_gmt":"2023-01-04T10:18:06","slug":"%e8%a7%a3%e6%b1%bareact-js%e4%b8%ad%e7%9a%84%e3%80%8c%e9%8c%af%e8%aa%a4%e3%80%8d","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/react-js\/%e8%a7%a3%e6%b1%bareact-js%e4%b8%ad%e7%9a%84%e3%80%8c%e9%8c%af%e8%aa%a4%e3%80%8d\/","title":{"rendered":"\u89e3\u6c7aReact.js\u4e2d\u7684\u300c<MyComponent>\u932f\u8aa4\u300d"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"React.js, Error, MyComponent, MyFile.js\"><\/p>\n<h1>\u89e3\u6c7a React.js \u4e2d\u7684\u300cError: The above error occurred in the <MyComponent> component: in MyFile.js:14\u300d\u932f\u8aa4<\/h1>\n<p>React.js \u662f\u4e00\u500b\u7528\u65bc\u69cb\u5efa\u7528\u6236\u754c\u9762\u7684 JavaScript \u5eab\uff0c\u5b83\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u5feb\u901f\u69cb\u5efa\u529f\u80fd\u5f37\u5927\u7684 Web \u61c9\u7528\u7a0b\u5e8f\u3002\u7136\u800c\uff0c\u5728\u958b\u767c\u904e\u7a0b\u4e2d\uff0c\u958b\u767c\u8005\u53ef\u80fd\u6703\u9047\u5230\u4e00\u4e9b\u932f\u8aa4\uff0c\u5176\u4e2d\u4e00\u500b\u5e38\u898b\u7684\u932f\u8aa4\u662f\u300cError: The above error occurred in the <MyComponent> component: in MyFile.js:14\u300d\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u89e3\u6c7a\u9019\u500b\u932f\u8aa4\u3002<\/p>\n<h2>\u4ec0\u9ebc\u662f\u300cError: The above error occurred in the <MyComponent> component: in MyFile.js:14\u300d\u932f\u8aa4\uff1f<\/h2>\n<p>\u300cError: The above error occurred in the <MyComponent> component: in MyFile.js:14\u300d\u932f\u8aa4\u662f React.js \u4e2d\u4e00\u500b\u5e38\u898b\u7684\u932f\u8aa4\uff0c\u5b83\u8868\u660e\u5728 MyFile.js \u6587\u4ef6\u7684\u7b2c 14 \u884c\u4e2d\u7684 MyComponent \u7d44\u4ef6\u51fa\u73fe\u4e86\u932f\u8aa4\u3002\u9019\u500b\u932f\u8aa4\u53ef\u80fd\u662f\u7531\u65bc\u7a0b\u5e8f\u78bc\u4e2d\u7684\u932f\u8aa4\u5f15\u8d77\u7684\uff0c\u4e5f\u53ef\u80fd\u662f\u7531\u65bc\u7a0b\u5e8f\u78bc\u4e2d\u7684\u67d0\u4e9b\u7f3a\u5931\u5f15\u8d77\u7684\u3002<\/p>\n<h2>\u5982\u4f55\u89e3\u6c7a\u300cError: The above error occurred in the <MyComponent> component: in MyFile.js:14\u300d\u932f\u8aa4\uff1f<\/h2>\n<p>\u89e3\u6c7a\u300cError: The above error occurred in the <MyComponent> component: in MyFile.js:14\u300d\u932f\u8aa4\u7684\u6700\u4f73\u65b9\u6cd5\u662f\u6aa2\u67e5 MyFile.js \u6587\u4ef6\u4e2d\u7684\u7b2c 14 \u884c\uff0c\u4ee5\u78ba\u5b9a\u662f\u5426\u6709\u4efb\u4f55\u932f\u8aa4\u6216\u7f3a\u5931\u7684\u7a0b\u5e8f\u78bc\u3002\u5982\u679c\u60a8\u767c\u73fe\u4e86\u4efb\u4f55\u932f\u8aa4\u6216\u7f3a\u5931\u7684\u7a0b\u5e8f\u78bc\uff0c\u8acb\u7acb\u5373\u4fee\u5fa9\u5b83\u5011\uff0c\u4ee5\u907f\u514d\u51fa\u73fe\u932f\u8aa4\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u60a8\u9084\u53ef\u4ee5\u4f7f\u7528 React.js \u7684\u9664\u932f\u5de5\u5177\u4f86\u6aa2\u67e5\u7a0b\u5e8f\u78bc\u4e2d\u7684\u932f\u8aa4\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528 Chrome \u7684\u958b\u767c\u8005\u5de5\u5177\u4f86\u6aa2\u67e5\u7a0b\u5e8f\u78bc\u4e2d\u7684\u932f\u8aa4\uff0c\u4e26\u67e5\u770b\u63a7\u5236\u53f0\u4e2d\u7684\u932f\u8aa4\u8a0a\u606f\uff0c\u4ee5\u7372\u5f97\u66f4\u591a\u6709\u95dc\u932f\u8aa4\u7684\u8a73\u7d30\u4fe1\u606f\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u60a8\u9084\u53ef\u4ee5\u4f7f\u7528 React.js \u7684\u932f\u8aa4\u8ffd\u8e64\u5de5\u5177\u4f86\u6aa2\u67e5\u7a0b\u5e8f\u78bc\u4e2d\u7684\u932f\u8aa4\u3002\u9019\u4e9b\u5de5\u5177\u53ef\u4ee5\u8ffd\u8e64\u7a0b\u5e8f\u78bc\u4e2d\u7684\u932f\u8aa4\uff0c\u4e26\u63d0\u4f9b\u6709\u95dc\u932f\u8aa4\u7684\u8a73\u7d30\u4fe1\u606f\uff0c\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u5feb\u901f\u89e3\u6c7a\u554f\u984c\u3002<\/p>\n<h2>\u7e3d\u7d50<\/h2>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u8a73\u7d30\u4ecb\u7d39\u4e86\u5982\u4f55\u89e3\u6c7a React.js \u4e2d\u7684\u300cError: The above error occurred in the <MyComponent> component: in MyFile.js:14\u300d\u932f\u8aa4\u3002\u6211\u5011\u5efa\u8b70\u60a8\u6aa2\u67e5 MyFile.js \u6587\u4ef6\u4e2d\u7684\u7b2c 14 \u884c\uff0c\u4ee5\u78ba\u5b9a\u662f\u5426\u6709\u4efb\u4f55\u932f\u8aa4\u6216\u7f3a\u5931\u7684\u7a0b\u5e8f\u78bc\uff0c\u4e26\u4f7f\u7528 React.js \u7684\u9664\u932f\u5de5\u5177\u548c\u932f\u8aa4\u8ffd\u8e64\u5de5\u5177\u4f86\u6aa2\u67e5\u7a0b\u5e8f\u78bc\u4e2d\u7684\u932f\u8aa4\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u66f4\u591a\u8cc7\u6e90<\/h2>\n<p>\u5982\u679c\u60a8\u60f3\u4e86\u89e3\u66f4\u591a\u95dc\u65bc React.js \u4e2d\u7684\u300cError: The above error occurred in the <MyComponent> component: in MyFile.js:14\u300d\u932f\u8aa4\u7684\u4fe1\u606f\uff0c\u8acb\u53c3\u95b1\u4ee5\u4e0b\u8cc7\u6e90\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/reactjs.org\/docs\/error-decoder.html\" target=\"_blank\" rel=\"noopener\">React.js \u932f\u8aa4\u89e3\u78bc\u5668<\/a><\/li>\n<li><a href=\"https:\/\/reactjs.org\/docs\/debugging.html\" target=\"_blank\" rel=\"noopener\">React.js \u9664\u932f<\/a><\/li>\n<li><a href=\"https:\/\/reactjs.org\/docs\/error-tracking.html\" target=\"_blank\" rel=\"noopener\">React.js \u932f\u8aa4\u8ffd\u8e64<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u89e3\u6c7aReact.js\u4e2d\u7684\u300c<MyComponent>\u932f\u8aa4\u300d\uff0c\u4e26\u63d0\u4f9b\u4e00\u4e9b\u6709\u7528\u7684\u6280\u5de7\uff0c\u4ee5\u4fbf\u958b\u767c\u8005\u80fd\u5920\u5feb\u901f\u89e3\u6c7a\u554f\u984c\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[184,183],"tags":[182,181],"class_list":["post-4772","post","type-post","status-publish","format-standard","hentry","category-react","category-react-js","tag-react","tag-react-js"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-1eY","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=4772"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4772\/revisions"}],"predecessor-version":[{"id":4773,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4772\/revisions\/4773"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=4772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=4772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=4772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}