taiki-t's diary

React Native, Rails そして雑多な記録: The world is waiting for you to give it a meaning.

2017-03-01から1ヶ月間の記事一覧

おーい磯野〜 callback使ってる関数をPromiseでラップしてasync/awaitで書こうぜ〜

JS

例1 const sleep = (ms) => { return new Promise(resolve => setTimeout(resolve, ms)); } const something = async () => { await sleep(100) doSomething() } 例2 Geolocation.getCurrentPosition() - Web API インターフェイス | MDN から // 元メソッド…

Relay: viewerとかrootにあるのよく見るけどあれアンチパターンらしいよ

関連しそうな記述があるものをとりあえずまとめておく。 Possible optimization related to setVariables and Node · Issue #1370 · facebook/relay · GitHub Viewer ID and node interface implementation · Issue #1542 · facebook/relay · GitHub

Reactエレメント、コンポーネント、そしてインスタンス

React Components, Elements, and Instances - React Blog を読んだメモ エレメント(要素) エレメントは、コンポーネントインスタンスまたはDOMノードを記述する、普通のオブジェクト エレメントは、実際のインスタンスではない エレメントは、何を画面上…

React Nativeでのナビゲーションに便利なReact Navigation

2018-5-10追記: 先日v2も出ました。今目にしているブログ記事はだいぶ古いと思うので注意です。React Navigation (v2) · Routing and navigation for your React Native apps 2017/9/15追記: React Navigationは開発サイクルがしばらく停滞していたけれど、…

React NativeでiOSのランディングスクリーンに画像を設定する方法

という記事を書いた。 taiki-t.hatenablog.com だいたい図にした。constrainsの設定の時だけ、対象のオブジェクトからviewへcontrol + click してドラッグというのがわかりにくいかも。

React Native から S3に画像アップロード

という記事を雑にかいた。 taiki-t.hatenablog.com コードは参考になると良いと思う。

Presigned post to aws s3 from React Native

It took a longtime to figure out how to upload images to aws s3 using presigned post from React Native. The key part is to use FormData to construct a payload and post it with POST http method. PUTing FormData payload with pre-signed URL d…

Make commit messages great again.

github.com github.com github.com https://github.com/search?p=1&q=make+again&ref=searchresults&type=Commits&utf8=%E2%9C%93