スポンサーリンク

いつになったらRedux入門できるの?(9)react-redux-starter-kitでfirebaseその2

前回、以下のサイトの写経に失敗した。

http://qiita.com/konyavic/items/02d6ed5d4071a8679fe3
image_thumb

http://twosquirrel.mints.ne.jp/?p=12934

(環境)
Windows8.1
VisualCodeStudio

今回、もう一度、githubのコピペでもいいので、とにかくやってみたい。

(1)react-redux-starter-kitの導入

git clone https://github.com/davezuko/react-redux-starter-kit.git redux-starter-todo
cd redux-starter-todo
npm install     (だいぶ時間がかかる、10分くらい?)
npm start

ブラウザでhttp://localhost:3000

image_thumb2

ここまでは簡単。

(2)routeを追加する

https://github.com/konyavic/react-redux-firebase-todo/commit/8f50a3b178f2e37742040c15e44a0d6d41c14f67#diff-e1f803c0d4525859fb1897bbdf3964d2

をもう、本当にCtrl+C、Ctrl+V でもいいのでしっかりコピペ。
rails (Ruby)と違って、redux (Javascript)は、ソースコードを読んでもかなり理解できない部分が多い。

image

大文字小文字にも注意。

src/routes/Todo/components/Todo.js
image

src/routes/Todo/containers/TodoContainer.js
image

src/routes/Todo/modules/todo.js  ← これ、本当に何をやっているのか意味不明。。。
image

src/routes/Todo/index.js
image

ここまでが、src/routes の中に、Todoフォルダを作成して作ったファイル群たち。

以下は、既存のファイルを修正。

src/routes/index.js
image

src/components/Header/Header.js
image

この状態で、

npm start

image

ブラウザでhttp://localhost:3000

image

image

とりあえず動いた。

ここまででかなり一苦労。。。Javascript難しすぎ、、、これでいったい何が得られるんだろう???

次は、firebaseの導入をやりたい。

http://qiita.com/konyavic/items/02d6ed5d4071a8679fe3

スポンサーリンク