Skip to Content
Reactビギナーズガイド ―コンポーネントベースのフロントエンド開発入門
book

Reactビギナーズガイド ―コンポーネントベースのフロントエンド開発入門

by Stoyan Stefanov, 牧野 聡
March 2017
Intermediate to advanced
248 pages
3h 10m
Japanese
O'Reilly Japan, Inc.
Content preview from Reactビギナーズガイド ―コンポーネントベースのフロントエンド開発入門

8章Flux

最後の章で紹介するのはFlux(https://facebook.github.io/fluz)です。Fluxはコンポーネント間のやり取りや、アプリケーション全体でのデータの流れを管理するための新しい方法です。ここまでの例では、親から子にプロパティを渡し、onDataChangeなどを使って子の側での変更を監視するといった方法がとられています。しかしこうすると、コンポーネントが持つプロパティの数が増えすぎてしまいます。すべてのプロパティの組み合わせの下で動作をテストするということが困難になります。

また、プロパティを子から孫そしてひ孫へとずっと渡してゆかなければならないという状況も考えられます。似たようなコードが繰り返されるというのは望ましくありません。しかも、コードの相互関係は複雑化し、コードを読む人々に精神的負担を強いるでしょう。

このような問題を解決し、アプリケーション内でのデータの流れを管理しやすくするために考えられたのがFluxです。Fluxという特定のライブラリがあるわけではなく、アプリケーションのデータを構成し整理するための考え方を意味します。ほとんどの場合、重要なのはデータです。ユーザーがアプリケーションを利用するのは、自らのお金やメールあるいは写真などのデータを管理するためです。UIが少しくらい不格好でも、ユーザーは我慢できます。しかしデータの状態については、常に混乱のないようにしなければなりません。例えば、ユーザーが送金したのかしていないのかわからないような状態は許されません。

Fluxの考えを実装したオープンソースのライブラリは多数あります。本書ではそれぞれについて見てゆくことはせず、より実践的なアプローチをとります。アイデアを把握して効果に納得できたら、各種のライブラリについて調査したり、自分だけのソリューションを考えたりするのもよいでしょう。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Unityによるモバイルゲーム開発 ―作りながら学ぶ2D/3Dゲームプログラミング入門

Unityによるモバイルゲーム開発 ―作りながら学ぶ2D/3Dゲームプログラミング入門

Jon Manning, Paris Buttfield-Addison, 鈴木 久貴, あんどうやすし, 江川 崇, 安藤 幸央, 高橋 憲一
scikit-learn、Keras、TensorFlowによる実践機械学習 第2版

scikit-learn、Keras、TensorFlowによる実践機械学習 第2版

Aurélien Géron, 下田 倫大, 長尾 高弘
初めてのSQL 第3版

初めてのSQL 第3版

Alan Beaulieu, 株式会社クイープ

Publisher Resources

ISBN: 9784873117881Other