{"id":13381,"date":"2021-04-29T21:29:03","date_gmt":"2021-04-29T12:29:03","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=13381"},"modified":"2023-09-20T23:59:18","modified_gmt":"2023-09-20T14:59:18","slug":"%e3%80%90react%e3%80%91%e3%80%8chooks%e3%80%8d%e3%81%a8%e3%80%8credux%e3%80%8d%e3%81%ae%e4%bd%bf%e3%81%84%e5%88%86%e3%81%91","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=13381","title":{"rendered":"\u3010React\u3011\u72b6\u614b\u7ba1\u7406\u306e\u9078\u629e\u80a2\uff08\u300cHooks\u300d\u3001\u300cRedux\u300d\u3001\u300cReact Query\u300d\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Hooks<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<ul>\n<li>React\u306e\u6a19\u6e96\u6a5f\u80fd\u306a\u306e\u3067\u5c0e\u5165\u304c\u697d\u3002<\/li>\n\n\n\n<li>useReducer\u306eReducer\u95a2\u6570\u306f\u7d14\u7c8b\u306aJavaScript\u306e\u30b3\u30fc\u30c9\u306a\u306e\u3067\u5358\u4f53\u30c6\u30b9\u30c8\u304c\u697d<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c7\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<ul>\n<li>\u5168\u3066\u306eReducer\u3092\u4e00\u3064\u306eStore\u306b\u683c\u7d0d\u3067\u304d\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u3002<\/li>\n\n\n\n<li>\u518d\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306e\u5bfe\u7b56\u306b\u5de5\u6570\u304c\u304b\u304b\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Redux<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<ul>\n<li>\u5168\u3066\u306eReducer\u3092combine\u3057\u3066\u4e00\u3064\u306estore\u306b\u683c\u7d0d\u3059\u308b\u3002<\/li>\n\n\n\n<li>Redux\u306b\u306f\u3057\u3063\u304b\u308a\u3068\u3057\u305f\u8a2d\u8a08\u539f\u5247\u304c\u3042\u308b\u3002<\/li>\n\n\n\n<li>Redux devtool\u304c\u9ad8\u6a5f\u80fd\u3067\u958b\u767a\u52b9\u7387\u304c\u4e0a\u304c\u308b\u3002<\/li>\n\n\n\n<li>Redux-saga\u3092\u4f7f\u3046\u3053\u3068\u3067\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3067\u304d\u308b\u3002<\/li>\n\n\n\n<li>Redux Tool Kit\u3092\u4f7f\u3046\u3053\u3068\u3067\u518d\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306e\u5bfe\u7b56\u304c\u7c21\u5358<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c7\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<ul>\n<li>React\u6a19\u6e96\u3067\u306f\u306a\u3044\u306e\u3067\u5225\u9014\u5c0e\u5165\u304c\u5fc5\u8981\u3002<\/li>\n\n\n\n<li>\u8a18\u8ff0\u304c\u5206\u65ad\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u51e6\u7406\u3092\u8ffd\u3046\u306e\u304c\u5927\u5909\uff08\u4ed6\u4eba\u304c\u66f8\u3044\u305fAction\u3084Reducer\u3092\u4e00\u901a\u308a\u8ffd\u3063\u3066\u7406\u89e3\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u306f\u304d\u3064\u3044\u3002\uff09<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Hooks\u3068Redux\u3092\u7528\u3044\u305f\u72b6\u614b\u7ba1\u7406\u306e\u9078\u629e\u80a2<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">useState + useReducer + useContext + combineReducer(Redux)<\/h3>\n\n\n\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067Hooks\u304c\u30d9\u30fc\u30b9\u3067\u3082Redux\u306b\u8fd1\u3044\u3053\u3068\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002\u6bd4\u8f03\u7684<span style=\"color: #ff0000;\"><strong>\u5c0f\u898f\u6a21\u30a2\u30d7\u30ea\u3067\u5c0e\u5165<\/strong><\/span>\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">useState<\/h4>\n\n\n\n<p>\u5168\u3066\u306e\u72b6\u614b\u7ba1\u7406\u3092Redux\u3067\u884c\u3046\u306e\u3067\u306f\u306a\u304f\u3001\u4f8b\u3048\u3070\u30e6\u30fc\u30b6\u30fc\u306e\u753b\u9762\u5165\u529b\u306a\u3069\u306e\u7c21\u6613\u7684\u306a\u72b6\u614b\u306e\u4fdd\u6301\u3067\u306fuseState\u3092\u4f7f\u3063\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u8fd1\u5e74\uff082020\u5e74\u4ee5\u964d\uff09\u306e\u9078\u629e\u80a2<\/h2>\n\n\n\n<p>\u5f93\u6765\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf(API\u306b\u30d5\u30a7\u30c3\u30c1\u3057\u306a\u3044\u30c7\u30fc\u30bf\u3001\u4f8b\u3048\u3070\u3001\u30dc\u30bf\u30f3\u306e\u72b6\u614b\u306a\u3069)\u3068\u3001\u30b5\u30fc\u30d0\u30fc\u30c7\u30fc\u30bf\uff08API\u306b\u30d5\u30a7\u30c3\u30c1\u3059\u308b\u30c7\u30fc\u30bf\u3001\u4f8b\u3048\u3070\u3001\u30bf\u30b9\u30af\u4e00\u89a7\u60c5\u5831\uff09\u3069\u3061\u3089\u3082\u540c\u3058store\u3067\u7ba1\u7406\u3059\u308b\u8a2d\u8a08\u304c\u666e\u901a\u3067\u3057\u305f\u3002\u4eca\u5f8c\u306f\u3053\u306e\u4e8c\u3064\u3092\u5206\u3051\u3066\u8003\u3048\u3066\u3044\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305f\u3001Redux\u3084useContext\u306f\u3069\u3061\u3089\u3082\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b5\u30fc\u30d0\u30fc\u30c7\u30fc\u30bf\u4fdd\u6301<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">React Query<\/h4>\n\n\n\n<p>\u30b5\u30fc\u30d0\u30fc\u30c7\u30fc\u30bf\u306b\u95a2\u3057\u3066\u306fRedux\u3092\u4f7f\u308f\u305a\u306bReact Query\u306b\u4efb\u305b\u308b\u3068\u3044\u3046\u9078\u629e\u80a2\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002Redux\u3068\u9055\u3063\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u96e2\u308c\u305f\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3082cache\u7d4c\u7531\u3067\u30c7\u30fc\u30bf\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<ul>\n<li>API\u3068\u30ad\u30fc\u304c\u72ec\u7acb\u3057\u3066\u3044\u308b\u3002<\/li>\n\n\n\n<li>\u623b\u308a\u5024\u3067isLoading\u304c\u3042\u308b\u3002<\/li>\n\n\n\n<li>\u30c7\u30d0\u30c3\u30b0\u30c4\u30fc\u30eb(ReactQueryDevTool)\u304c\u3042\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">useSWR<\/h4>\n\n\n\n<p>Next.js\u3092\u5c0e\u5165\u3059\u308b\u5834\u5408\u306b\u9078\u629e\u80a2\u3068\u3057\u3066\u6319\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul>\n<li>\u30ad\u30fc\u304cAPI\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/li>\n\n\n\n<li>\u623b\u308a\u5024\u3067isLoading\u304c\u306a\u3044<\/li>\n\n\n\n<li>\u30c7\u30d0\u30c3\u30b0\u30c4\u30fc\u30eb\u306f\u306a\u3044\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a2\u30d7\u30ea\u30c7\u30fc\u30bf\u4fdd\u6301<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Redux ToolKit<\/h4>\n\n\n\n<p>\u8fd1\u5e74\u306f\u3001Redux\u3092\u305d\u306e\u307e\u307e\u4f7f\u3046\u3068\u3044\u3046\u3088\u308a\u306f\u3088\u308a\u4f7f\u3044\u3084\u3059\u304f\u306a\u3063\u305fRedux ToolKit\u3067\u306e\u72b6\u614b\u4fdd\u6301\u304c\u4e3b\u6d41\u3068\u306a\u308a\u3064\u3064\u3042\u308a\u307e\u3059\u3002useContext\u3092\u4f7f\u3046\u5834\u5408\u306b\u6bd4\u3079\u3066\u518d\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306e\u5bfe\u7b56\u3082\u7c21\u5358\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">useState or useReducer + useContext<\/h4>\n\n\n\n<p>React Hooks\u3092\u4f7f\u3063\u305f\u3053\u3061\u3089\u306e\u9078\u629e\u80a2\u3067\u3082\u826f\u3044\u3067\u3057\u3087\u3046\u3002\u518d\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306e\u5bfe\u7b56\u306b\u5de5\u6570\u304c\u304b\u304b\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Hooks \u30e1\u30ea\u30c3\u30c8 \u30c7\u30e1\u30ea\u30c3\u30c8 Redux \u30e1\u30ea\u30c3\u30c8 \u30c7\u30e1\u30ea\u30c3\u30c8 Hooks\u3068Redux\u3092\u7528\u3044\u305f\u72b6\u614b\u7ba1\u7406\u306e\u9078\u629e\u80a2 useState + useReducer + useContext + combineReducer( [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[116,117],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13381"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13381"}],"version-history":[{"count":13,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13381\/revisions"}],"predecessor-version":[{"id":23051,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13381\/revisions\/23051"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13381"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}