{"id":1624,"date":"2021-08-08T12:51:46","date_gmt":"2021-08-08T03:51:46","guid":{"rendered":"http:\/\/www.agile-software.site\/?p=1624"},"modified":"2021-09-05T15:49:20","modified_gmt":"2021-09-05T06:49:20","slug":"reacthookssns","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=1624","title":{"rendered":"ReactHooks[SNS]"},"content":{"rendered":"\n<div class=\"wp-block-jin-gb-block-box-with-headline kaisetsu-box1\"><div class=\"kaisetsu-box1-title\">\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8<\/div>\n<p>API\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306eURI<\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">React\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npx create-react-app  sns-react<\/code><\/pre><\/div>\n\n\n\n<p>\u4f5c\u6210\u3057\u305fsns-react\u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Material UI<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npm install @material-ui\/core\nnpm install @material-ui\/icons\nnpm install react-cookie\nnpm install react-icons\nnpm install axios\nnpm install --save react-router-dom<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">src&lt;components<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">src&lt;context<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">App.js<\/h2>\n\n\n\n<p>React Material-UI\u3067\u306f<code>ThemeProvider<\/code>\u306b\u30c6\u30fc\u30de\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6e21\u3059\u3053\u3068\u3067\u30d5\u30a9\u30f3\u30c8\u3084\u30c6\u30fc\u30de\u306e\u8272\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002\u30c6\u30fc\u30de\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f<code>createMuiTheme<\/code>\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8272\u3068\u30d5\u30a9\u30f3\u30c8\u3092\u5909\u66f4<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>const theme = createMuiTheme({\n  palette: {\n    primary: indigo,\n    secondary: {\n      main: &quot;#f44336&quot;,\n    },\n  },\n  typography: {\n    fontFamily: &quot;Comic Neue&quot;,\n  },\n});<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>import React from &quot;react&quot;;\nimport &quot;.\/App.css&quot;;\n\nimport { createMuiTheme } from &quot;@material-ui\/core\/styles&quot;;\nimport { ThemeProvider as MuiThemeProvider } from &quot;@material-ui\/core\/styles&quot;;\nimport indigo from &quot;@material-ui\/core\/colors\/indigo&quot;;\nimport Navbar from &quot;.\/components\/Navbar&quot;;\nimport ApiContextProvider from &quot;.\/context\/ApiContext.js&quot;;\nimport Main from &quot;.\/components\/Main&quot;;\n\nconst theme = createMuiTheme({\n  palette: {\n    primary: indigo,\n    secondary: {\n      main: &quot;#f44336&quot;,\n    },\n  },\n  typography: {\n    fontFamily: &quot;Comic Neue&quot;,\n  },\n});\n\nfunction App() {\n  return (\n    &lt;ApiContextProvider&gt;\n      &lt;MuiThemeProvider theme={theme}&gt;\n        &lt;Navbar \/&gt;\n        &lt;div className=&quot;container&quot;&gt;\n          &lt;Main \/&gt;\n        &lt;\/div&gt;\n      &lt;\/MuiThemeProvider&gt;\n    &lt;\/ApiContextProvider&gt;\n  );\n}\n\nexport default App;<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Login.js<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5165\u529b\u30d5\u30a9\u30fc\u30e0<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Login<\/h4>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code> &lt;TextField\n              variant=&quot;outlined&quot;\n              margin=&quot;normal&quot;\n              fullWidth\n              label=&quot;Email&quot;\n              name=&quot;username&quot;\n              value={state.credentialsLog.username}\n              onChange={inputChangedLog()}\n              autoFocus\n            \/&gt;\n          ) <\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">register<\/h4>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>(\n            &lt;TextField\n              variant=&quot;outlined&quot;\n              margin=&quot;normal&quot;\n              fullWidth\n              label=&quot;Email&quot;\n              name=&quot;email&quot;\n              value={state.credentialsReg.email}\n              onChange={inputChangedReg()}\n              autoFocus\n            \/&gt;\n          )<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">button<\/h4>\n\n\n\n<h2 class=\"wp-block-heading\">context&lt;ApiContext.js<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>React\u306e\u30a4\u30f3\u30dd\u30fc\u30c8 \u4f5c\u6210\u3057\u305fsns-react\u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002 Material UI srclt;components srclt;context App.js React Material-UI\u3067\u306fTh<\/p>\n","protected":false},"author":1,"featured_media":1736,"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-1624","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\/1624","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=1624"}],"version-history":[{"count":2,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1624\/revisions"}],"predecessor-version":[{"id":1735,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1624\/revisions\/1735"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/media\/1736"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}