{"id":4516,"date":"2025-06-03T14:05:08","date_gmt":"2025-06-04T06:10:07","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=4516"},"modified":"2025-06-04T14:05:08","modified_gmt":"2025-06-04T06:10:07","slug":"%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%9dreact-js","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/react-js\/%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%9dreact-js\/","title":{"rendered":"\u5feb\u901f\u4e0a\u624b React.js\uff1a\u5b8c\u6574\u5b89\u88dd\u6307\u5357\u8207\u6700\u4f73\u5be6\u8e10"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"React, React \u5b89\u88dd, React \u6559\u5b78, JavaScript \u51fd\u5f0f\u5eab\"><\/p>\n<h1>\u5feb\u901f\u4e0a\u624b React.js\uff1a\u5b8c\u6574\u5b89\u88dd\u6307\u5357\u8207\u6700\u4f73\u5be6\u8e10<\/h1>\n<p>React \u662f\u7531 Facebook \u958b\u767c\u7684\u4e00\u6b3e\u5f37\u5927\u7684 JavaScript \u51fd\u5f0f\u5eab\uff0c\u5c08\u70ba\u5efa\u7acb\u4e92\u52d5\u5f0f\u7db2\u9801\u61c9\u7528\u7a0b\u5f0f\u800c\u8a2d\u8a08\u3002\u5b83\u7684\u5143\u4ef6\u5316\u67b6\u69cb\u4f7f\u5f97\u958b\u767c\u8005\u80fd\u5920\u8f15\u9b06\u5730\u5c07\u61c9\u7528\u7a0b\u5f0f\u62c6\u5206\u70ba\u7368\u7acb\u7684\u5143\u4ef6\uff0c\u4e26\u9748\u6d3b\u5730\u5c07\u9019\u4e9b\u5143\u4ef6\u7d44\u5408\u5728\u4e00\u8d77\uff0c\u5275\u9020\u51fa\u9ad8\u6548\u4e14\u53ef\u7dad\u8b77\u7684\u61c9\u7528\u7a0b\u5f0f\u3002<\/p>\n<p>\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5011\u5c07\u4ecb\u7d39\u5982\u4f55\u5feb\u901f\u5b89\u88dd React\uff0c\u4e26\u5be6\u73fe\u4f60\u7684\u7b2c\u4e00\u500b React \u61c9\u7528\u7a0b\u5f0f\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u5b89\u88dd\u524d\u7684\u6e96\u5099<\/h2>\n<p>\u8981\u958b\u59cb\u4f7f\u7528 React\uff0c\u9996\u5148\u5fc5\u9808\u78ba\u4fdd\u4f60\u5df2\u5b89\u88dd <strong>Node.js<\/strong>\u3002Node.js \u662f\u4e00\u500b\u70ba JavaScript \u63d0\u4f9b\u4f3a\u670d\u5668\u7aef\u57f7\u884c\u74b0\u5883\u7684\u5de5\u5177\uff0c\u4e26\u4e14\u5305\u542b\u4e86\u5957\u4ef6\u7ba1\u7406\u5de5\u5177 <strong>npm<\/strong>\uff08Node Package Manager\uff09\uff0c\u9019\u4f7f\u5f97\u5b89\u88dd React \u8b8a\u5f97\u66f4\u52a0\u65b9\u4fbf\u3002<\/p>\n<h2>\u6b65\u9a5f 1\uff1a\u5b89\u88dd Node.js<\/h2>\n<p>\u4f60\u53ef\u4ee5\u5f9e <a href=\"https:\/\/nodejs.org\/\" target=\"_blank\" rel=\"noopener\">Node.js \u5b98\u65b9\u7db2\u7ad9<\/a> \u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684\u5b89\u88dd\u7a0b\u5f0f\uff0c\u4e26\u6309\u7167\u6307\u793a\u5b8c\u6210\u5b89\u88dd\u3002\u5b89\u88dd\u5f8c\uff0c\u6253\u958b\u547d\u4ee4\u5217\u4ecb\u9762\uff0c\u8f38\u5165\u4ee5\u4e0b\u547d\u4ee4\u4f86\u78ba\u8a8d Node.js \u662f\u5426\u5b89\u88dd\u6210\u529f\uff1a<\/p>\n<pre class=\"brush: python\">node -v<\/pre>\n<h2>\u6b65\u9a5f 2\uff1a\u5b89\u88dd Create React App<\/h2>\n<p>\u5b8c\u6210 Node.js \u7684\u5b89\u88dd\u5f8c\uff0c\u63a5\u4e0b\u4f86\u53ef\u4ee5\u4f7f\u7528 npm \u4f86\u5b89\u88dd <strong>Create React App<\/strong>\uff0c\u9019\u662f\u4e00\u500b\u5b98\u65b9\u63d0\u4f9b\u7684\u5de5\u5177\uff0c\u53ef\u5e6b\u52a9\u958b\u767c\u8005\u5feb\u901f\u5efa\u7acb React \u61c9\u7528\u7a0b\u5f0f\u7684\u9aa8\u67b6\u3002\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5168\u57df\u5b89\u88dd Create React App\uff1a<\/p>\n<pre class=\"brush: python\">npm install -g create-react-app<\/pre>\n<h2>\u6b65\u9a5f 3\uff1a\u5efa\u7acb\u4f60\u7684\u7b2c\u4e00\u500b React \u61c9\u7528\u7a0b\u5f0f<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5efa\u7acb\u4e00\u500b\u65b0\u7684 React \u61c9\u7528\u7a0b\u5f0f\uff1a<\/p>\n<pre class=\"brush: python\">create-react-app my-app<\/pre>\n<p>\u9019\u5c07\u6703\u5728\u7576\u524d\u76ee\u9304\u4e0b\u5efa\u7acb\u4e00\u500b\u540d\u70ba <strong>my-app<\/strong> \u7684\u8cc7\u6599\u593e\uff0c\u4e26\u4e14\u5305\u542b\u4e86\u6240\u6709\u5fc5\u8981\u7684\u6587\u4ef6\u548c\u7d50\u69cb\u3002<\/p>\n<h2>\u6b65\u9a5f 4\uff1a\u555f\u52d5\u61c9\u7528\u7a0b\u5f0f<\/h2>\n<p>\u63a5\u8457\uff0c\u4f60\u9700\u8981\u9032\u5165\u5230\u4f60\u7684\u61c9\u7528\u7a0b\u5f0f\u8cc7\u6599\u593e\uff0c\u518d\u555f\u52d5\u958b\u767c\u4f3a\u670d\u5668\uff1a<\/p>\n<pre class=\"brush: python\">cd my-app<\/pre>\n<pre class=\"brush: python\">npm start<\/pre>\n<p>\u9019\u6703\u5728\u700f\u89bd\u5668\u4e2d\u81ea\u52d5\u6253\u958b\u4f60\u7684\u61c9\u7528\u7a0b\u5f0f\uff0c\u4e26\u4e14\u7576\u4f60\u5c0d\u4ee3\u78bc\u9032\u884c\u66f4\u6539\u6642\uff0c\u9801\u9762\u6703\u81ea\u52d5\u5237\u65b0\u3002<\/p>\n<h2>\u7d50\u8a9e<\/h2>\n<p>\u5b89\u88dd React \u4e26\u4e0d\u56f0\u96e3\uff0c\u73fe\u5728\u4f60\u5df2\u7d93\u5b8c\u6210\u4e86\u7b2c\u4e00\u500b React \u61c9\u7528\u7a0b\u5f0f\u7684\u5efa\u7acb\uff01\u5982\u679c\u4f60\u60f3\u8981\u66f4\u6df1\u5165\u5730\u4e86\u89e3 React \u7684\u4f7f\u7528\uff0c\u5efa\u8b70\u53c3\u8003 <a href=\"https:\/\/reactjs.org\/docs\/getting-started.html\" target=\"_blank\" rel=\"noopener\">React \u5b98\u65b9\u6587\u4ef6<\/a>\uff0c\u4ee5\u7372\u53d6\u66f4\u591a\u8cc7\u6e90\u548c\u6700\u4f73\u5be6\u8e10\u3002<\/p>\n<p>\u96a8\u8457\u4f60\u5c0d React \u7684\u4e86\u89e3\u52a0\u6df1\uff0c\u4f60\u5c07\u80fd\u5920\u5275\u5efa\u51fa\u66f4\u8907\u96dc\u4e14\u529f\u80fd\u8c50\u5bcc\u7684\u61c9\u7528\u7a0b\u5f0f\u3002\u795d\u4f60\u5b78\u7fd2\u6109\u5feb\uff01<\/p>\n<p>&#8212;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5feb\u901f\u5b89\u88ddReact.js\uff0c\u4e86\u89e3React.js\u7684\u5b89\u88dd\u6b65\u9a5f\uff0c\u4e26\u77ad\u89e3\u5982\u4f55\u4f7f\u7528React.js\u958b\u767c\u7db2\u9801\u61c9\u7528\u7a0b\u5f0f\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-4516","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-1aQ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4516","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=4516"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4516\/revisions"}],"predecessor-version":[{"id":4517,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4516\/revisions\/4517"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=4516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=4516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=4516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}