<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by sa.nitawaki on Medium]]></title>
        <description><![CDATA[Stories by sa.nitawaki on Medium]]></description>
        <link>https://medium.com/@sa-nitawaki?source=rss-3c971e986f13------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xwkbkRQ4QpTKTJYfuczbag.jpeg</url>
            <title>Stories by sa.nitawaki on Medium</title>
            <link>https://medium.com/@sa-nitawaki?source=rss-3c971e986f13------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:57:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sa-nitawaki/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[書くことはつまり思考すること]]></title>
            <link>https://sa-nitawaki.medium.com/%E6%9B%B8%E3%81%8F%E3%81%93%E3%81%A8%E3%81%AF%E3%81%A4%E3%81%BE%E3%82%8A%E6%80%9D%E8%80%83%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8-a1bd4f00ba1d?source=rss-3c971e986f13------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1bd4f00ba1d</guid>
            <dc:creator><![CDATA[sa.nitawaki]]></dc:creator>
            <pubDate>Sat, 18 Jan 2025 03:06:43 GMT</pubDate>
            <atom:updated>2025-01-18T03:06:43.448Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>思ったことや気付き、混乱したことなどここに書いて考えを整理しましょう。書くことはつまり思考することです。</blockquote><p>最近利用している <a href="https://www.stayinsession.com/?ref=nitaking.dev">Session</a> というアプリには、メモ欄がある。</p><p><a href="https://www.stayinsession.com/?ref=nitaking.dev">Pomodoro focus timer with analytics</a></p><p><a href="https://www.stayinsession.com/?ref=nitaking.dev">Start your momentum by focusing in 25-minute sessions. Session helps you focus and be more mindful by blocking distractions and tracking your progress</a></p><p><a href="https://www.stayinsession.com/?ref=nitaking.dev">Pomodoro focus timer with analytics</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oBjw07WnwiSDib1v.png" /></figure><p>ポモドーロタイマー、Focusアプリでメモ欄があるのは珍しい。そのメモ欄に上記のPlaceholderがあるのだが、興味深い。</p><p>よくこれまでの職場では、SlackのTimesチャンネルで個人の思考を書いていたり、Issue上での思考整理をする人がいたり、Twitter(X)で思考整理をするひとがいる。スタイルはそれぞれの方々あるだろうが、深い思考と連動しているようにみえる。</p><p>自分においても、Timesなどで思考を垂れ流しながら作業をしたことがある。これは横からアドバイスが生まれたりする点がメリットだが、他者のノイズにもなるのでデメリットでもある。</p><p>自分にしか見えない一人のSlackチャンネル、Discordチャンネルでもやったことがあるが、悪くはなかった。</p><p>では、Sessionアプリのように、「タスクに紐づいて思考プロセスを書く」というのはどうか。非常によかった。まず、何を書いても問題ない。当たり前だが、どんな思考をしても問題ない、受け入れられる。</p><p>思考の沼や作業の沼にハマることがあっても、ポモドーロタイマーによって思考は中断され、休憩後にその思考から再開してもよいし、切り替えてもよい。メモも履歴があり、コピーして再開ができる。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wCgCZEA8ks5EUnv-.png" /><figcaption>Session for macOS</figcaption></figure><p>タスクにはカテゴリがあるので、「現在のカテゴリー」の思考を確認できる。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*k4LKYRzFDixWOVp7.png" /><figcaption>メモ履歴</figcaption></figure><p>これは過去のタスクの思い出しがとても捗り、コンテキストスイッチの軽減を感じた。いちいちセーブポイントがなくても、そのときの思考のスナップショットに脳が戻る感じだ。</p><p>個人の趣味においても、仕事においても、とても思考に役立っているので、おすすめしたい。これを使わずにやる作業と、使ったときの作業とでは結構やりやすさの違いを体感した１週間だった。</p><p>ちなみに、ポモドーロタイマーとしても優秀。</p><p>タスクの開始時には深呼吸がセットされる。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wo8yMDujRjR0Obl2.png" /></figure><p>タスクの終了時には、集中できたか、気付きはあったかもメモできる。なぜ集中できたか・できなかったかが整理でき、きちんとクロージングしてから次に進むことの習慣化が進む。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*acPn4uSx7gwYRjQV.png" /></figure><p>そして、iPhoneアプリやmacOSではサイトやアプリのブロッキング機能がある。LINE開いたりX開いたりできなくできる。もはや現代の人間には必須機能なのではと思っている。やはり推しなのである。</p><p><a href="https://www.nitaking.dev/recommend-session-app/">www.nitaking.dev/recommend...</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1bd4f00ba1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to do working Prisma code completion for WebStorm(InteliJ)?]]></title>
            <link>https://sa-nitawaki.medium.com/how-to-do-working-prisma-code-completion-for-webstorm-intelij-e7f0c4c4706c?source=rss-3c971e986f13------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7f0c4c4706c</guid>
            <category><![CDATA[prisma]]></category>
            <category><![CDATA[blitz]]></category>
            <category><![CDATA[webstorm]]></category>
            <dc:creator><![CDATA[sa.nitawaki]]></dc:creator>
            <pubDate>Sat, 16 Jan 2021 16:48:32 GMT</pubDate>
            <atom:updated>2021-01-16T16:48:32.437Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you using Prisma or a Prisma framework (like Blitz)?<br>Are you using WebStorm?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*znWjkMUxlQBKpomk" /><figcaption>Photo by <a href="https://unsplash.com/@andrewtneel?utm_source=medium&amp;utm_medium=referral">Andrew Neel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I love Prisma because it is type safe. <br>However, for some reason, my WebStorm did not listen to me. <br>There is no code completion. <br>That’s strange, because VSCode is listening to me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZEeupgYq_2lhtyNVpLJ_w.png" /><figcaption>Where’s the schema I defined?</figcaption></figure><h3>How to do?</h3><blockquote>.prisma folder -&gt; Mark Directory as -&gt; Cancel Exclusion</blockquote><blockquote><a href="https://github.com/prisma/prisma/issues/2359#issuecomment-739921212">https://github.com/prisma/prisma/issues/2359#issuecomment-739921212</a></blockquote><p>Yes, the reason is that you are excluding the node_modules distribution.<br>Let’s remove the definition file generated by Prisma, `.prisma’, from the exclusion. It works.</p><figure><img alt="Success code completion" src="https://cdn-images-1.medium.com/max/1024/1*kW0B9QaOXacDxeLzPGiOOw.png" /><figcaption>Yeah, I see Prisma’s schema.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xJg8oSZLmzjPk964J8_Xw.png" /><figcaption>Can look at the schema I’ve defined!</figcaption></figure><p>Now, let’s enjoy a comfortable Prisma life!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7f0c4c4706c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to work with inline SVG in Blitz.js(Nextjs)]]></title>
            <link>https://sa-nitawaki.medium.com/how-to-work-with-inline-svg-in-blitz-js-nextjs-c0b86f8986d4?source=rss-3c971e986f13------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0b86f8986d4</guid>
            <category><![CDATA[blitzjs]]></category>
            <category><![CDATA[blitz]]></category>
            <category><![CDATA[next]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[sa.nitawaki]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 03:30:24 GMT</pubDate>
            <atom:updated>2020-09-26T10:24:46.428Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to work with inline SVG in Blitz.js(Next.js)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XKKn0y0mGb00zwYl" /></figure><p>In Blitz.js, it was taken up by issue that the inline SVG does not work when set up as documented in Blitz.js.</p><p>This is an issue with Next.js and is covered in issue <a href="https://github.com/vercel/next.js/issues/14892">here</a>.<br>Blitz.js is built on top of Next.js and the front end is equivalent to Next.js.<br>It can be solved with the same response as Next.js</p><h3>First — Install packages</h3><pre>$ yarn add babel-plugin-inline-react-svg<br>$ yarn add babel-plugin-module-resolver</pre><h3>Second — Edit babel.config.js</h3><pre>module.exports = {<br>  presets: [&quot;next/babel&quot;],<br>  plugins: [<br>    [&quot;module-resolver&quot;, { &quot;root&quot;: [&quot;.&quot;] }],<br>    &quot;inline-react-svg&quot;,<br>  ],<br>}</pre><p>Now you should be able to view your SVGs!</p><p>If you don’t know how to do it, I’ve uploaded the source to Github and you can take a look at it.</p><p><a href="https://github.com/nitaking/sample-blitz-svg-setting">nitaking/sample-blitz-svg-setting</a></p><p>Click <a href="https://github.com/nitaking/sample-blitz-svg-setting/commit/58649f378bbce466fa43e29418c1a03260bfbb92">here</a> for specific commitments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZNFb0E2JHczatLZQ.png" /><figcaption>It shows up like this 🙌</figcaption></figure><p>Have a good Blitz.js life!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0b86f8986d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enjoy your commit with gitmoji-c]]></title>
            <link>https://sa-nitawaki.medium.com/enjoy-your-commit-with-gitmoji-c-1eca5fe35143?source=rss-3c971e986f13------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eca5fe35143</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[emoji]]></category>
            <category><![CDATA[gitmoji]]></category>
            <dc:creator><![CDATA[sa.nitawaki]]></dc:creator>
            <pubDate>Sun, 30 Jun 2019 09:14:09 GMT</pubDate>
            <atom:updated>2020-03-25T07:46:28.827Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9dJ2cGgDDZsOi0ec" /><figcaption><a href="https://gitmoji.carloscuesta.me/">https://gitmoji.carloscuesta.me/</a></figcaption></figure><p>My company has a ‘gitmoj’ culture.<br>This is the practice of putting ‘gitmoji’ at the beginning of the commit message when committing.</p><p>For example, The commit of Android is linked to the following emoji</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/0*lZoHh8R8XXKHbZCB" /></figure><p>You just add this to your prefix at git commit.</p><pre>:robot: Build Error Fix</pre><p>Then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*JxmlS6QGS6uUtGbw" /></figure><p>Looks like this on github.<br>It makes it easy to understand, “Does this fix Anroid’s build error?”</p><p>It’s just fun.<br>And the amount of information on commit messages will increase steadily.</p><p>When you look for the old commit, just get tired.</p><p>But if you have a gitmoji commit message your can filter by ‘:robot:’ and your can find it right away.</p><pre>$ git log --oneline --grep :robot<br>xxxxxxx :robot::lipstick:[AIRCLOSET-2010] Fix: TextInputでタブバーが押し上げられる現象fix</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2gF_oRTS58FkyMe8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yvnx2a3y0Jd2gUf-" /><figcaption>The boring commit list is also gourgeous thanks to gitmoji.</figcaption></figure><h3>Problem 1: The trouble of finding the gitmoji code</h3><p>gitmoji is published on the web page.<br><a href="https://gitmoji.carloscuesta.me/">https://gitmoji.carloscuesta.me/</a></p><p>Went to the site every time I made a commit.<br>This is a bother!</p><p>When you make a rare commit, you have to look into it.</p><blockquote>ex: wip, fix CI etc…</blockquote><h3>Problem 2: Typo</h3><p>You don’t need to explain it.<br>Yes, it’s typo…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/0*QHiLgmvWZ0gu2NSk" /><figcaption>No Coool!!</figcaption></figure><h3>My Solution</h3><p>There is something like <a href="https://github.com/carloscuesta/gitmoji-cli">gitmoji-cli</a>.</p><p>This is a great CLI tool.<br>gitmoji list, search, commit… there is a desired function.</p><p>But. There is one complaint.</p><p>Ask for gpg at commit time.<br>Is seems to solve if you set something, but it is not cool to ask for by default.</p><p>It was easy, so I made My gitmoji-cli!</p><h3>gitmoji-c</h3><p><a href="https://github.com/nitaking/gitmoji-c">nitaking/gitmoji-c</a></p><pre>$ yarn global add gitmoji-c</pre><h4>Show gitmoji list:</h4><pre>$ gitmoji list </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*VUNI0IFaydqumaaz" /></figure><h4>Search gitmoji:</h4><pre>$ gitmoji list -s &lt;search word&gt;<br># or<br>$ gitmoji list --search=&lt;search word&gt;<br># or<br>$ gitmoji list &lt;search word&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*tAVNdK11j5pYzmLD" /></figure><h4>Commit of gitmoji:</h4><pre>$ gitmoji commit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dz_CEgRVP2wVsGav" /></figure><p>In the case of me, I’m planning to extend the function to gitmoji-c because there is a need to “write more than one gitmoji by commit”!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7iiDpQTvX9RdvMdJ" /><figcaption>Gitmoji is also displayed on the your terminal.</figcaption></figure><h3>How to Create?</h3><h4>oclif</h4><p>I made it with Node and TypeScript.<br>The oclif is excellent, and it provides a good environment at the time of initial.</p><ul><li><a href="https://oclif.io/">oclif: The Open CLI Framework · Create command line tools your users love</a></li><li><a href="https://github.com/oclif/oclif">GitHub - oclif/oclif: Node.js Open CLI Framework. Built by Salesforce.</a></li></ul><h4>inquirer</h4><p>The gitmoji-c commit is a response CLI.</p><ol><li>Select gitmoji</li><li>Input commit title</li><li>Input commit message</li></ol><p>You will be ased to enter.</p><p>An implementer of this response CLI is ‘inquirer’.</p><p><a href="https://github.com/SBoudrias/Inquirer.js/">SBoudrias/Inquirer.js</a></p><p>Originally intended to use ‘enquirer’, but did not know how to present options based on external data.</p><pre>class Prompt {<br>  public get questions() {<br>    return [<br>      {<br>        name: &#39;gitmoji&#39;,<br>        message: &#39;Choose a gitmoji:&#39;,<br>        type: &#39;autocomplete&#39;,<br>        async source(_: any, input: { toLowerCase(): void; }) {<br>          const emojiList = await gitmojis()<br>          const searchResult = emojiList.filter((gitmoji: IGitmoji) =&gt; {<br>            const emoji = gitmoji.name.concat(gitmoji.description).toLowerCase()<br>            // @ts-ignore<br>            return (!input || emoji.indexOf(input.toLowerCase()) !== -1)<br>          })<br><br>          return displayValue(searchResult)<br>        }<br>      },<br>      {<br>        name: &#39;title&#39;,<br>        message: &#39;Enter the commit title&#39;,<br>      },<br>      {<br>        name: &#39;message&#39;,<br>        message: &#39;Enter the commit message:&#39;,<br>      },<br>    ]<br>  }<br>}</pre><p>Let&#39;s commit well with gitmoji and gitmoji-c.</p><p><a href="https://github.com/nitaking/gitmoji-c">nitaking/gitmoji-c</a></p><pre>$ yarn global add gitmoji-c</pre><figure><a href="https://www.buymeacoffee.com/axIqgPk"><img alt="" src="https://cdn-images-1.medium.com/max/400/0*hi29hhGl8sDBBcFP.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eca5fe35143" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native Todo App with Hooks]]></title>
            <link>https://sa-nitawaki.medium.com/react-native-todo-app-with-hooks-5f279ae2beb6?source=rss-3c971e986f13------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f279ae2beb6</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[sa.nitawaki]]></dc:creator>
            <pubDate>Sat, 01 Dec 2018 16:28:14 GMT</pubDate>
            <atom:updated>2020-09-23T10:44:37.091Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This: English translation article <a href="https://qiita.com/nitaking/items/e9bf4c52046004ef3186">post</a>. Tell me that there was a weird place as it translates on google.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*5BpaS2E0KwK1UCnx" /></figure><p>With Hooks, you can now handle state with Function Conponent.You came to see articles on Todo apps and so on using useState.</p><p>Let’s use Hooks with React Native this time.</p><p>What is React Hooks, what is useState, what you do not know please check the following. ↓</p><ul><li><a href="https://qiita.com/YutamaKotaro/items/ef0430f570779dcf8a26">【React】新機能hooks — Qiita</a></li><li><a href="https://blog.weareredlight.com/the-rise-of-functional-components-react-v16-7-0-now-with-hooks-90cac72b8ab7">The Rise of Functional Components — React v16.7.0 (now with Hooks!)</a></li></ul><p>Please note that Hooks is an alpha version to the last.</p><h3>Setup</h3><pre>$ react-native init hooks_todo</pre><p>As of November 26, 2018, react native does not correspond to hooks.<br>To use it clone from react repository, blah blah blah … It’s troublesome.</p><blockquote><a href="https://github.com/facebook/react-native/issues/21967#issuecomment-434113687"><em>Using React Hooks in React Native · Issue #21967 · facebook/react-native</em></a></blockquote><p>This time we will use the prepared react-native which volunteers are forking!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*sYTtdBUO5crfF7Rf7vvNaQ.png" /><figcaption>cool.</figcaption></figure><blockquote><a href="https://github.com/facebook/react-native/issues/21967#issuecomment-438473603">https://github.com/facebook/react-native/issues/21967#issuecomment-438473603</a></blockquote><pre>$ yarn add react@next react-native@&quot;npm:@brunolemos/react-native&quot;</pre><h4>Note</h4><p>If it does not work, the following error will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/0*jqfGr8QAvQb0lrNS" /></figure><blockquote>It seems that libraries called <a href="https://github.com/react-native-community/react-native-hooks">react-native-hooks</a> are beginning to be made. This seems to be a built-in module of react-native hooks as a wrapper, so we will not mention it in this article!</blockquote><h4>Next</h4><pre>$ yarn start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/0*C61amcbPc4vZPhBl" /><figcaption>The familiar screen appeared.</figcaption></figure><h3>native-base</h3><p>Here, we use native-base to improve visibility.</p><pre>$ yarn add native-base<br>$ react-native link</pre><h3>configuration</h3><p>This time it is composed referring to this <a href="https://itnext.io/making-a-beautiful-todo-app-using-react-hooks-material-ui-52dacf3245f4">post</a>.</p><p><strong>Component</strong></p><ul><li>Layout</li><li>Todo Form</li><li>Todo List</li></ul><p><strong>Function</strong></p><ul><li>Add Todo</li><li>Todo complete / un complete</li><li>Delete Todo</li></ul><p>In this time we will use useState and extend it.</p><h3>Development</h3><h4>&lt;Layout&gt;</h4><p>Create a Component with &lt;Header&gt;.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cbebfe1d399838a8d13c350ef11c69c/href">https://medium.com/media/2cbebfe1d399838a8d13c350ef11c69c/href</a></iframe><h4>&lt;AddTodoForm&gt;</h4><p>Component with TextInput and input button<br>We will implement it with Input and Icon of native-base.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/74506e1b4af1b5593a55aacc83d08a73/href">https://medium.com/media/74506e1b4af1b5593a55aacc83d08a73/href</a></iframe><h4>&lt;TodoList&gt;</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8e722e241b4958daa0d0a2c77158dcc/href">https://medium.com/media/a8e722e241b4958daa0d0a2c77158dcc/href</a></iframe><p><strong>What React.memo?</strong></p><pre>-- const Component = (props) =&gt; {};<br>++ const Component = memo((props) =&gt; {});</pre><p>In React, performance becomes worse if there are many re-renders.<br>Performance tuning is done so that re-rendering is not performed if props is the same with shouldComponentUpdate,<br>For Class Component there was a React.PureComponent that shouldComponentUpdate by default.<br>It is React.memo that this is implemented by Function Component.</p><h4>App.js</h4><p>Will pass custom useState to each Component in App.js.<br>I define a wrapper for useState in hooks / todoList.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb0eb32e7f7f7be2c1554af46f33f59d/href">https://medium.com/media/bb0eb32e7f7f7be2c1554af46f33f59d/href</a></iframe><h3>custom hooks</h3><p>This Case, in order to compensate for the use which is not enough with useState …</p><pre>const [state, setState] = useState(initialState);</pre><p>Create wrappers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12a7f94724549f9ddaa36555261bad5b/href">https://medium.com/media/12a7f94724549f9ddaa36555261bad5b/href</a></iframe><h4>Then …</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/0*TDi3wnvn40JUuD6k" /></figure><p>Hooks can be used for applications that are lighter than redux, and easy to use.</p><p>thank you for reading.</p><blockquote><em>github: </em><a href="https://github.com/nitaking/react-native-hooks-todo"><em>nitaking/react-native-hooks-todo</em></a></blockquote><figure><a href="https://www.buymeacoffee.com/axIqgPk"><img alt="" src="https://cdn-images-1.medium.com/max/400/1*IDQUm6DrAAda6XlAOq_jWQ.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f279ae2beb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rename react-native app]]></title>
            <link>https://sa-nitawaki.medium.com/rename-react-native-app-4a16df78703e?source=rss-3c971e986f13------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a16df78703e</guid>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[sa.nitawaki]]></dc:creator>
            <pubDate>Thu, 29 Nov 2018 10:21:28 GMT</pubDate>
            <atom:updated>2020-03-25T08:17:31.697Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s easy.</p><p>use: react-native-rename<a href="https://github.com/junedomingo/react-native-rename"><br>https://github.com/junedomingo/react-native-rename</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jwnQjRknmvDf5mybQKDq6w.png" /></figure><pre>yarn global add react-native-rename</pre><pre>react-native-rename &lt;newName&gt;</pre><p>This is the complete!</p><figure><a href="https://www.buymeacoffee.com/axIqgPk"><img alt="" src="https://cdn-images-1.medium.com/max/400/1*IDQUm6DrAAda6XlAOq_jWQ.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a16df78703e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s Todo App with Vue Native : Part1]]></title>
            <link>https://sa-nitawaki.medium.com/lets-todo-app-with-vue-native-part1-af2494ae568b?source=rss-3c971e986f13------2</link>
            <guid isPermaLink="false">https://medium.com/p/af2494ae568b</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[vue-native]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[sa.nitawaki]]></dc:creator>
            <pubDate>Mon, 25 Jun 2018 00:57:26 GMT</pubDate>
            <atom:updated>2020-03-25T08:19:19.820Z</atom:updated>
            <content:encoded><![CDATA[<p>This: English translation article <a href="https://qiita.com/nitaking/items/5c6fb6990d3bdb5769cc">post</a>. Tell me that there was a weird place as it translates on google.</p><p>VueNative is a topic. It has exceeded 3000 github Stars in a few days after it was released.</p><h3>Sanket Sahu on Twitter</h3><p>Introducing Vue Native! https://t.co/vIjdcELvkV</p><p>This post, write down on the console output.</p><h4>what to do:</h4><p>What happens when you clone the ReactNative application?<br>Will do the following post with VueNative.</p><ul><li><a href="https://qiita.com/YutamaKotaro/items/dd7846c6db15e2307daa">【React Native入門】Java Scriptでアプリ作ろう【Reactやったことない人者向け】１</a></li><li><a href="https://qiita.com/YutamaKotaro/items/0521d83049536e451f15">【React Native入門】Java Scriptでアプリ作ろう【Reactやったことない人向け】2</a></li></ul><p>VueNative is on ReactNative, may be better to know the summary of ReactNative first.</p><h3>Create Project</h3><p><a href="https://vue-native.io/docs/installation.html">Installation — Vue Native</a></p><p>Make application using `Vue Native Cli`.<br>In addition, need `create-react-native-app`. Let’s do a global install.</p><pre>yarn global add create-react-native-app<br>yarn global add vue-native-cli<br>vue-native init todoapp<br>cd todoapp/</pre><h3>Start App</h3><pre>yarn start</pre><p>Then, QR code can do such a result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JNQpcZLoA1xfkhz8" /><figcaption>result: yarn start</figcaption></figure><p>ios emulator starts with i.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*I93qJiT49jlwDXwn" /></figure><h4><strong>Note:</strong></h4><p>This is the development environment provided by the create-react-native-appintroduced earlier. create-react-native-app is created by expo and facebook in collaboration.</p><p>Anyways, Vue Native seems to be wrapping React Native internally, maybe vue-native-cli also wraps create-react-native-app and implements it.</p><p>This create-react-native-app will run the application using Expo without going through xcode or Android Studio.<br>It is very time consuming when mine stepping on xcode and Android Studio build environment (Android in particular). I feel like using Expo, it is a meaningful tool for developers, just to think about application implementation.</p><p>Nonetheless, when you customize it you have to go away. . . There may be timing at the time of introduction.</p><p>By the way, when using the QR code to check from the smartphone application at hand, please connect to the same network (WiFi). (Because this 192.168.160.30 is the local IP address)</p><h3>Change the color</h3><p>Edit App.vue with the following contents.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d14496592a1238950f517357e8a8bdb/href">https://medium.com/media/2d14496592a1238950f517357e8a8bdb/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*OSKklU0h3LNCWTMX" /><figcaption>The image is Japanese, but do not worry</figcaption></figure><h3>Create component</h3><p>Add a button to add the Todo input form and its Todo to the list.<br>Create src/TodoInput.vue.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ab9d1d800ed514d91e7d2594b393754/href">https://medium.com/media/1ab9d1d800ed514d91e7d2594b393754/href</a></iframe><p>By the way, it becomes like this when writing with ReactNative.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85715eb2f8d6a502cc180aa91d9c273b/href">https://medium.com/media/85715eb2f8d6a502cc180aa91d9c273b/href</a></iframe><h3>About components</h3><p>VueNative is implemented using ReactNative components.<br>Since we are implementing <a href="https://github.com/SmallComfort/react-vue">react-vue</a> forking, it is OK to replace the ReactNative component name from the CamelCase (Kebab-case) to the Kebab case (kebab-case).</p><blockquote><a href="https://blog.geekyants.com/introducing-vue-native-b66f71d50438">Introducing Vue Native — GeekyAnts Blog</a></blockquote><p>I write &lt;TouchableOpacity&gt; as &lt;touchable-opacity&gt; here.</p><h3>Style</h3><p>ReactNative uses StyleSheet and defines CSS as an object of js (CSS in JS). In other words, it can not be written with pure CSS.<br>Vue Native can write in CSS. Sounds good.</p><p>The case with ReactNative</p><pre>buttonText: {<br>    color: &#39;#FFF&#39;,<br>    fontWeight: &#39;500&#39;,<br>  }</pre><p>The case with VueNative</p><pre>.button-text {<br>    color: white;<br>    font-weight: normal;<br>}</pre><p>…</p><p>By the way, there seem to be CSS which does not correspond.</p><pre>font-size: large;</pre><p>It does not apply.</p><p>From Vue’s CSS, I feel that the mapping to ReactNative’s style is not working well.<br>(Can not map by react-vue?)</p><p>I encountered a pattern that would cause a build error and a pattern that would not be the case, but since I can not pursue the condition, I will write it as soon as I understand it.</p><h3>Loading components</h3><p>Let’s incorporate TodoInput.vue into App.vue.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc5921ca16e6ffcfbb47d624c0a139f5/href">https://medium.com/media/fc5921ca16e6ffcfbb47d624c0a139f5/href</a></iframe><ol><li>Import TextInput with script tag.</li><li>Define TextInput as components in the script tag.</li><li>Describe the component in kebab case: &lt;text-input /&gt;.</li></ol><p>Then it will be displayed on the screen like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*9OcpM3Sig8S3Q3NT" /><figcaption>`Add` is in Japanese but I do not care</figcaption></figure><h3>Console Output</h3><p>Let’s make it possible to output to console by entering text and pressing add button.</p><p>App.vue does the following editing.</p><pre>-      &lt;text-input /&gt;<br>+      &lt;text-input<br>+        :on-add=&#39;_onPress&#39;<br>+      /&gt;</pre><pre>export default {<br>    components: {<br>      TextInput<br>-    }<br>-  }<br>+    },<br>+    methods: {<br>+      _onPress : (text) =&gt; {<br>+        console.log(text);<br>+      },<br>+    }<br>+  }</pre><ul><li>Define the function in App.vue</li><li>Pass that function _ onPress to TextInput as on-add (onAdd)</li></ul><p>Next, edit of TodoInput.vue.</p><pre>-        &lt;text-input class=&quot;text-input&quot; /&gt;<br>-        &lt;touchable-opacity class=&quot;button&quot;&gt;<br>+        &lt;text-input class=&quot;text-input&quot; v-model=&quot;newText&quot; /&gt;<br>+        &lt;touchable-opacity class=&quot;button&quot; :on-press=&quot;addTodo&quot;&gt;</pre><pre>&lt;script&gt;<br>    export default {<br>+        props: {<br>+            onAdd: Function<br>+        },<br>+        methods: {<br>+          addTodo: function() {<br>+            this.onAdd(this.newText)<br>+          },<br>+        }<br>    }<br>&lt;/script&gt;</pre><p>Please enter text and press the add button.</p><p>Then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sOMOXun698CSmmzj" /></figure><p>The contents of console.log are output to the terminal.<br>If you use xcode, it will be output to the chrome console, but here (expo) is the output to the terminal.</p><p>Once it is here.</p><p>Source is given to github, so please do not hesitate to contact us if you do not understand!</p><p><a href="https://github.com/nitaking/vue-native-todo/tree/bcf8bfec7deb63ff17075c2717274ccdc87eff87">nitaking/vue-native-todo</a></p><figure><a href="https://www.buymeacoffee.com/axIqgPk"><img alt="" src="https://cdn-images-1.medium.com/max/400/1*IDQUm6DrAAda6XlAOq_jWQ.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af2494ae568b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[デフォルトシェルをfishに変えるな]]></title>
            <link>https://sa-nitawaki.medium.com/%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%92fish%E3%81%AB%E5%A4%89%E3%81%88%E3%82%8B%E3%81%AA-d9233b39335e?source=rss-3c971e986f13------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9233b39335e</guid>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[japanese]]></category>
            <category><![CDATA[fish]]></category>
            <category><![CDATA[error-handling]]></category>
            <dc:creator><![CDATA[sa.nitawaki]]></dc:creator>
            <pubDate>Mon, 18 Dec 2017 03:48:13 GMT</pubDate>
            <atom:updated>2020-03-25T08:20:03.937Z</atom:updated>
            <content:encoded><![CDATA[<h4>デフォルトシェルをbashからfishに変えてからrbenvの設定が通らなくなった</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*bMtIpdm7IpZa8FYSgIg-Tg@2x.png" /></figure><p>まず、bashからfishにデフォルトシェルを変えた。bashを使ってて特に不満はなかったけど、コマンドの補完機能がないのが使いにくかった。fishを使うと補完機能が素晴らしすぎ＆いろいろと捗るものでした。<br>(z でのディレクトリ移動最高。)</p><h3>sa-nitawaki on Twitter</h3><p>初めてシェルコマンドをbashから変えてみたけど、もっと早く変えてればよかった</p><p>ここで安易にデフォルトシェルをfishに変えてしまったんですが、後々後悔することに。</p><h4>rbenvでつまづく</h4><p>違和感に気づいたのは、rubyの環境を整えようとrbenvを使用してrubyをインストールしたとき。</p><h4>rbenv で ruby の環境を整えられず</h4><p>rbenvでインストールしたのに設定が反映されない。</p><pre>$ ~&gt; rbenv versions<br>  system<br>  2.2.2<br>* 2.2.3 (set by /Users/nitawaki/.rbenv/version)</pre><p>`ruby 2.2.3p173`が返ってくるはずが返ってこない。</p><pre>$ ~&gt; ruby -v<br>ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]</pre><p>以下の内容を.bash_profileに記載しても適用されない。</p><pre>eval &quot;$(rbenv init -)&quot;</pre><h3>なぜか</h3><p>fishに切り替えた後は特に問題がないように見えて、実はbashとfishでは構文が違うので、.bash_profileに記載していた内容が全部エラーになってしまった。<br>bash上で.bash_profileのエラーは表示されるが、fishのシェル上だとコマンドライン上ではエラーが表示されず、shell初心者には検知できない状態に。</p><h3>そこで</h3><p>デフォルトシェルをfishからbashに戻し、.bashrcに</p><pre>exec fish</pre><p>を追記することで、.bash_profile, .bashrcの設定読み込み後にfishを起動する流れに変更してみた。</p><h3>だがしかし</h3><p>まだrbenvでrubyのバージョンが切り替わらない。<br>このときの.bash_profileと.bashrcの内容を見てみる</p><p>.<strong>bash_profile</strong></p><pre>if [ -f ~/.bashrc ] ; then<br>. ~/.bashrc<br>fi</pre><pre>export PATH=$PATH:$(go env GOPATH)/bin<br>export GOPATH=$(go env GOPATH)</pre><pre># Setting PATH for Python 3.4<br># The orginal version is saved in .bash_profile.pysave<br>PATH=&quot;/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}&quot;<br>export PATH</pre><pre>eval &quot;$(rbenv init -)&quot;</pre><p><strong>.bashrc</strong></p><pre># nodebrew<br>export PATH=$PATH:$HOME/.nodebrew/current/bin<br># direnv<br>eval &quot;$(direnv hook bash)&quot;</pre><pre># EB CLI<br>export PATH=$PATH:</pre><pre>exec fish</pre><p>はい。ごちゃごちゃと関係のない記載がありますが、<br>このミスに気づくのにfishインストールしてから３週間かかりました。</p><p>.bash_profileの1~3行目で「.bashrcがあれば読み込む」という処理があります。 コレにより、2行目で.bashrcを読み込みに行き、fishが起動されてしまうことに。<br>.bash_profileの末尾に追加された eval “$(rbenv init -)” は読み込まれませんでした。</p><h4>修正後</h4><p>以下の内容にdo</p><p><strong>.bash_profile</strong></p><pre># (その他設定など)</pre><pre># 1.Setting rbenv<br>eval &quot;$(rbenv init -)&quot;</pre><pre># 2.bashrc がある場合は bashrc を読み込む<br>if [ -f ~/.bashrc ] ; then<br>. ~/.bashrc<br>fi</pre><pre># 3.bash_profile の読み込み完了後に fish の起動.<br>exec fish</pre><p><strong>.bashrc</strong></p><pre># (.bashrc設定)</pre><p>ruby -vも想定値に。</p><pre>$ ruby -v<br>ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin16]</pre><pre>$ which ruby<br>/Users/nitawaki/.rbenv/shims/ruby<br>$ which gem<br>/Users/nitawaki/.rbenv/shims/gem</pre><p>which rubyも usr/bin/ruby から rbenvのディレクトリを参照するようになった・・・。一安心</p><h3>教訓</h3><ol><li><strong>安易にデフォルトシェルは切り替えるな</strong><br>思いもよらないことが起こる</li><li><strong>意味がわからないままdotfileはいじるな</strong><br>アルゴリズムがわからないままプログラムするのと同じことになる</li></ol><figure><a href="https://www.buymeacoffee.com/axIqgPk"><img alt="" src="https://cdn-images-1.medium.com/max/400/1*IDQUm6DrAAda6XlAOq_jWQ.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9233b39335e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>