{"id":2056,"date":"2022-07-17T07:40:40","date_gmt":"2022-07-16T22:40:40","guid":{"rendered":"http:\/\/www.agile-software.site\/?p=2056"},"modified":"2022-07-17T08:16:59","modified_gmt":"2022-07-16T23:16:59","slug":"%e7%8a%b6%e6%85%8b%e7%ae%a1%e7%90%86%e3%81%ae%e7%90%86%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=2056","title":{"rendered":"\u72b6\u614b\u7ba1\u7406\u306e\u7406\u89e3"},"content":{"rendered":"\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5236\u4f5c\u306b\u304a\u3044\u3066<code>state<\/code>\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u306f\u5927\u4e8b\u3067\u3059\u3002React\u3067<code>state<\/code>\u7ba1\u7406\u3068\u8a00\u3063\u305f\u3089\u3059\u3050<code>useState<\/code>\u304c\u982d\u306e\u4e2d\u306b\u6d6e\u304b\u3073\u307e\u3059\u306d\u3002\u78ba\u304b\u306b<code>useState<\/code>\u3067<code>state<\/code>\u3092\u5168\u90e8\u7ba1\u7406\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001<code>useState<\/code>\u3067\u7ba1\u7406\u3057\u3066\u308bstate\u3092\u305f\u304f\u3055\u3093\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u4f7f\u3063\u3066\u3044\u308b\u3068\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"350\" src=\"http:\/\/www.agile-software.site\/wp-content\/uploads\/2022\/07\/state1.png\" alt=\"\" class=\"wp-image-2057\" srcset=\"https:\/\/agile-software.net\/wp-content\/uploads\/2022\/07\/state1.png 1000w, https:\/\/agile-software.net\/wp-content\/uploads\/2022\/07\/state1-300x105.png 300w, https:\/\/agile-software.net\/wp-content\/uploads\/2022\/07\/state1-768x269.png 768w, http:\/\/www.agile-software.site\/wp-content\/uploads\/2022\/07\/state1.png 856w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>\u3042\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067<code>state<\/code>\u306e\u5909\u66f4\u304c\u8d77\u3053\u308a\u3001\u305d\u306e<code>state<\/code>\u3092\u4f7f\u3063\u3066\u308b\u4ed6\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u5909\u66f4\u3092\u4f1d\u3048\u308b\u56f3\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong><code>state<\/code>\u306f\u5225\u9014\u30b9\u30c8\u30ec\u30fc\u30b8\u307f\u305f\u3044\u306a\u3068\u3053\u308d\u3067\u4e00\u62ec\u3067\u7ba1\u7406\u3059\u308b\u3068\u697d<\/strong>\u3068\u601d\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u305d\u308c\u304c<strong>Redux\u3068Context API\u304c\u3084\u3063\u3066\u308b\u3053\u3068<\/strong>\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"350\" src=\"http:\/\/www.agile-software.site\/wp-content\/uploads\/2022\/07\/state2.png\" alt=\"\" class=\"wp-image-2058\" srcset=\"https:\/\/agile-software.net\/wp-content\/uploads\/2022\/07\/state2.png 1000w, https:\/\/agile-software.net\/wp-content\/uploads\/2022\/07\/state2-300x105.png 300w, https:\/\/agile-software.net\/wp-content\/uploads\/2022\/07\/state2-768x269.png 768w, http:\/\/www.agile-software.site\/wp-content\/uploads\/2022\/07\/state2.png 856w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Redux<\/h2>\n\n\n\nhttp:\/\/www.agile-software.site\/2021\/08\/06\/redux%e3%81%a8%e3%81%af\/\n\n\n\n<h2 class=\"wp-block-heading\">Context API<\/h2>\n\n\n\nhttp:\/\/www.agile-software.site\/2022\/07\/17\/context-api\/\n\n\n\n<h2 class=\"wp-block-heading\">Redux\u3068Context API\u306e\u9055\u3044<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><\/h3>\n\n\n\n<p><strong>Redux\u306f\u30e9\u30a4\u30d6\u30e9\u30ea<\/strong>\u3067\u3059\u3002React\u3068\u4e00\u7dd2\u306b\u4f7f\u308f\u308c\u308b\u5834\u5408\u304c\u591a\u3044\u3067\u3059\u304c\u3001React\u3067\u306f\u306a\u3044\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af(Vue\u306a\u3069)\u3067\u3082\u4f7f\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>Context API\u306fReact\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308b\u6a5f\u80fd<\/strong>\u3067\u3059\u3002\u5f53\u305f\u308a\u524d\u306bReact\u3067\u306f\u306a\u3044\u3068\u4f7f\u3048\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e1\u30a4\u30f3\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u6570<\/h3>\n\n\n\n<p><strong>Redux\u306e<code>store<\/code>\u306f\u4e00\u3064\u3060\u3051\u3067\u3059<\/strong>\u3002\u3053\u306e\u4e00\u3064\u306e<code>store<\/code>\u3067\u3059\u3079\u3066\u306e<code>state<\/code>\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002\u30ed\u30b8\u30c3\u30af\u3092\u5206\u3051\u305f\u3044\u5834\u5408\u306f\u6a5f\u80fd\u3054\u3068\u306b<code>reducer<\/code>\u3092\u5206\u3051\u307e\u3059\u3002\u4f8b\u3048\u30c4\u30a4\u30c3\u30bf\u30fc\u3092\u4f5c\u308b\u3068\u3057\u305f\u3089\u300c\u30e6\u30fc\u30b6\u30fc\u306b\u95a2\u3059\u308b<code>reducer<\/code>\u300d\u3001\u300c\u6295\u7a3f\u306b\u95a2\u3059\u308b<code>reducer<\/code>\u300d\u306a\u3069\u306b\u306a\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>Context API\u306e<code>context<\/code>\u306f\u8907\u6570\u4f5c\u308c\u307e\u3059<\/strong>\u3002\u3067\u3059\u306e\u3067\u3001\u6a5f\u80fd\u3054\u3068\u306b<code>context<\/code>\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u30c4\u30a4\u30c3\u30bf\u30fc\u306e\u4f8b\u3060\u3063\u305f\u3089\u300c\u30e6\u30fc\u30b6\u30fc\u306b\u95a2\u3059\u308b<code>context<\/code>\u300d\u3001\u300c\u6295\u7a3f\u306b\u95a2\u3059\u308b<code>context<\/code>\u300d\u306a\u3069\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Middleware<\/h3>\n\n\n\n<p>Redux\u306e\u57fa\u672c\u6982\u5ff5\u3067<code>action<\/code>\u304c<code>reducer<\/code>\u306b\u9001\u3089\u308c\u308b\u3068\u8a71\u3057\u307e\u3057\u305f\u3002Middleware\u3092\u4f7f\u3046\u3068\u3053\u306e<code>action<\/code>\u304c<code>reducer<\/code>\u3067\u51e6\u7406\u3055\u308c\u308b\u524d\u306b\u4ed6\u306e\u4f5c\u696d\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001<\/p>\n\n\n\n<p>\u306a\u3069\u306a\u3069\u3067\u3059\u3002Middleware\u306f\u3088\u304f<strong>\u975e\u540c\u671f\u51e6\u7406<\/strong>\u3092\u6271\u3046\u6642\u306b\u4f7f\u308f\u308c\u3001\u4fbf\u5229\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>action<\/code>\u3092console\u306b\u8868\u793a\u3059\u308b(\u3082\u3057\u304f\u306f\u30b5\u30fc\u30d0\u30fc\u5074\u3067\u30ed\u30ae\u30f3\u30b0)<\/li><li>\u7279\u5b9a\u306e\u6761\u4ef6\u3067\u306f<code>action<\/code>\u3092\u7121\u8996\u3059\u308b<\/li><li>\u7279\u5b9a\u306e<code>action<\/code>\u304c\u767a\u751f\u3057\u305f\u3089javascript\u306e\u95a2\u6570\u3092\u5b9f\u884c\u3055\u305b\u308b<\/li><li>\u7279\u5b9a\u306e<code>action<\/code>\u304c\u767a\u751f\u3057\u305f\u3089\u4ed6\u306e<code>action<\/code>\u3082\u767a\u751f\u3055\u305b\u308b<\/li><\/ul>\n\n\n\n<p>context API\u306f<strong>Middleware\u4f7f\u3048\u306a\u3044<\/strong>\u306e\u3067\u3001\u3053\u306e\u3088\u3046\u306a\u975e\u540c\u671f\u51e6\u7406\u306e\u6a5f\u80fd\u306f\u5168\u90e8\u76f4\u63a5\u5b9f\u88c5\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5236\u4f5c\u306b\u304a\u3044\u3066state\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u306f\u5927\u4e8b\u3067\u3059\u3002React\u3067state\u7ba1\u7406\u3068\u8a00\u3063\u305f\u3089\u3059\u3050useState\u304c\u982d\u306e\u4e2d\u306b\u6d6e\u304b\u3073\u307e\u3059\u306d\u3002\u78ba\u304b\u306buseState\u3067state\u3092\u5168\u90e8\u7ba1\u7406\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002 \u3057\u304b\u3057\u3001u<\/p>\n","protected":false},"author":1,"featured_media":2068,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-2056","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2056"}],"version-history":[{"count":2,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2056\/revisions"}],"predecessor-version":[{"id":2067,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2056\/revisions\/2067"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/media\/2068"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}