From my observation, the Alert dialog seems built on top of the React Native app. So it pops out everytime you call it, and doesn't to be in the render function. The catch is it is not an async task so the code after Alert will continue to execute regardless the callback function. The code below demonstrates a situation where the Alert dialog keeps popping out because it reads the same barcode ove
ReactNativeでは簡単なデータならDBとか使わなくてもAsyncStorageを利用して保存できます。特に悩むことはありません。 基本的には、 設定:AsyncStorage.setItem('key','value'); 取得:AsyncStorage.getItem('key'); とするだけ。 本家サイトを参考に下記のように記述してみました。 名前(name)を受け取り保存。nameをAlertで出力。 import React from 'react'; import { StyleSheet, Text, View, Button, Alert } from 'react-native'; import { AsyncStorage } from "react-native" export default class App extends React.Component
デバッグ環境の整え方のメモ。 React いくつかやり方がありますが、ChromeのExtension使うのが一般的。 React Developer Tools 特に何も難しいことはない。インストールして、Reactが使われてるサイトを見れば、stateとの中身とか見れます。 Redux + Redux こちらもいくつかのツールが存在しますが、React DevTools Extensionを利用するのが一般的な感じ。但し、Chromeにツールを入れただけでは何も見えず、コードの中に必要な記述を行う必要がある。 コードはcreateStore()に埋め込むが、middlewareを利用するかによって記述が異なる。 以下はミドルウエアを利用する場合の記述。 どちらも覚えるのめんどいので、私は下記で統一しています。 私はcreateStoreってファイル作ることが多いのですが、下記のように記
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く