Full Download Learning React Functional Web Development with React and Redux 1st Edition Alex Banks PDF DOCX
Full Download Learning React Functional Web Development with React and Redux 1st Edition Alex Banks PDF DOCX
com
https://ebookname.com/product/learning-react-functional-web-
development-with-react-and-redux-1st-edition-alex-banks/
OR CLICK HERE
DOWLOAD NOW
https://ebookname.com/product/learning-react-native-building-native-
mobile-apps-with-javascript-1-early-release-edition-bonnie-eisenman/
ebookname.com
https://ebookname.com/product/the-road-to-react-the-react-js-in-
javascript-book-2024-edition-robin-wieruch/
ebookname.com
https://ebookname.com/product/learning-javascript-design-patterns-a-
javascript-and-react-developer-s-guide-2nd-edition-adnan-osmani/
ebookname.com
https://ebookname.com/product/essentials-of-clinical-social-work-1st-
edition-dr-jerrold-r-brandell-editor/
ebookname.com
Legal professional privilege in Australia Third Edition.
Edition Ronald J. Desiatnik
https://ebookname.com/product/legal-professional-privilege-in-
australia-third-edition-edition-ronald-j-desiatnik/
ebookname.com
https://ebookname.com/product/critical-thinking-for-strategic-
intelligence-3rd-edition-katherine-h-pherson/
ebookname.com
https://ebookname.com/product/bismarck-and-the-development-of-germany-
volume-iii-the-period-of-fortification-1880-1898-otto-pflanze/
ebookname.com
https://ebookname.com/product/beginning-autocad-2004-1st-edition-bob-
mcfarlane/
ebookname.com
https://ebookname.com/product/geometric-phases-in-physics-alfred-
shapere/
ebookname.com
Water and Salt The Essence of Life 1st Edition Dr Barbara
Hendel
https://ebookname.com/product/water-and-salt-the-essence-of-life-1st-
edition-dr-barbara-hendel/
ebookname.com
Learning React
Functional Web Development
with React and Redux
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Learning React, the cover image, and
related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the authors have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility
for errors or omissions, including without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.
978-1-491-95462-1
[LSI]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
1. Welcome to React. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Obstacles and Roadblocks 1
React Is a Library 2
New ECMAScript Syntax 2
Popularity of Functional JavaScript 2
JavaScript Tooling Fatigue 2
Why React Doesn’t Have to Be Hard to Learn 3
React’s Future 3
Keeping Up with the Changes 4
Working with the Files 4
File Repository 4
React Developer Tools 5
Installing Node.js 6
2. Emerging JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Declaring Variables in ES6 10
const 10
let 10
Template Strings 12
Default Parameters 13
Arrow Functions 14
Transpiling ES6 17
ES6 Objects and Arrays 19
Destructuring Assignment 19
Object Literal Enhancement 20
The Spread Operator 22
iii
Promises 24
Classes 25
ES6 Modules 27
CommonJS 28
4. Pure React. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Page Setup 59
The Virtual DOM 60
React Elements 62
ReactDOM 64
Children 65
Constructing Elements with Data 67
React Components 68
React.createClass 69
React.Component 72
Stateless Functional Components 73
DOM Rendering 74
Factories 77
iv | Table of Contents
Validating Props with createClass 110
Default Props 114
Custom Property Validation 115
ES6 Classes and Stateless Functional Components 116
Refs 119
Inverse Data Flow 121
Refs in Stateless Functional Components 123
React State Management 123
Introducing Component State 124
Initializing State from Properties 128
State Within the Component Tree 130
Color Organizer App Overview 130
Passing Properties Down the Component Tree 131
Passing Data Back Up the Component Tree 134
8. Redux. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
State 184
Actions 187
Action Payload Data 189
Reducers 190
The Color Reducer 193
The Colors Reducer 195
The Sort Reducer 197
Table of Contents | v
The Store 198
Subscribing to Stores 201
Saving to localStorage 202
Action Creators 203
Middleware 206
Applying Middleware to the Store 207
vi | Table of Contents
Universal Routing 310
Communicating with the Server 318
Completing Actions on the Server 318
Actions with Redux Thunks 321
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
This book is for developers who want to learn the React library while learning the
latest techniques currently emerging in the JavaScript language. This is an exciting
time to be a JavaScript developer. The ecosystem is exploding with new tools, syntax,
and best practices that promise to solve many of our development problems. Our aim
with this book is to organize these techniques, so you can get to work with React right
away. We’ll get into Redux, React Router, and build tooling, so we promise not to
introduce only the basics and then throw you to the wolves.
This book does not assume any knowledge of React at all. We’ll introduce all of
React’s basics from scratch. Similarly, we won’t assume that you’ve worked with ES6
or any of the latest JavaScript syntax. This will be introduced in Chapter 2 as founda‐
tion for the rest of the chapters.
You’ll be better prepared for the contents of the book if you’re comfortable with
HTML, CSS, and JavaScript. It’s almost always best to be comfortable with these big
three before diving into a JavaScript library.
Along the way, check out the GitHub repository. All of the examples are there and
will allow you to practice with hands-on examples.
ix
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values deter‐
mined by context.
x | Preface
If you feel your use of code examples falls outside fair use or the permission given
above, feel free to contact us at [email protected].
O’Reilly Safari
Safari (formerly Safari Books Online) is a membership-based
training and reference platform for enterprise, government,
educators, and individuals.
Members have access to thousands of books, training videos, Learning Paths, interac‐
tive tutorials, and curated playlists from over 250 publishers, including O’Reilly
Media, Harvard Business Review, Prentice Hall Professional, Addison-Wesley Profes‐
sional, Microsoft Press, Sams, Que, Peachpit Press, Adobe, Focal Press, Cisco Press,
John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe
Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, and
Course Technology, among others.
For more information, please visit http://oreilly.com/safari.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
We have a web page for this book, where we list errata, examples, and any additional
information. You can access this page at http://bit.ly/learning-react-2e.
To comment or ask technical questions about this book, send email to bookques‐
[email protected].
For more information about our books, courses, conferences, and news, see our web‐
site at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Preface | xi
Acknowledgments
Our journey with React wouldn’t have started without some good old fashioned luck.
We used YUI when we created the training materials for the full stack JavaScript pro‐
gram that we taught internally at Yahoo. Then in August 2014, development on YUI
ended. We had to change all of our course files, but to what? What were we supposed
to use on the front end now? The answer: React. We didn’t fall in love with React
immediately, it took us couple of hours to get hooked. It looked like React could
potentially change everything. We got in early and got really lucky.
This book would not have been possible without the support of Ally MacDonald who
helped us every step of the way and was monumentally patient with us through sev‐
eral library updates. We’re grateful to Melanie Yarbrough, Colleen Toporek, and
Rachel Head for their amazing attention to detail. Thanks to Sarah Ronau for proof‐
reading this book well before it was ready for human eyes and to Bonnie Eisenman
for her great advice and overall delightfulness. Thanks also to Stoyan Stefanov, who
was nice enough to provide a technical review even though he’s really busy building
cool stuff at Facebook.
There’s also no way this book could have existed without the Sharon Adams and
Marilyn Messineo. They conspired to purchase Alex’s first computer, a Tandy TRS 80
Color Computer. It also wouldn’t have made it to book form without the love, sup‐
port, and encouragement of Jim and Lorri Porcello, and Mike and Sharon Adams.
We’d also like to acknowledge Coffee Connexion in Tahoe City, California for giving
us the coffee we needed to finish this book, and its owner, Robin, who gave us the
timeless advice: “A book on programming? Sounds boring!”
xii | Preface
CHAPTER 1
Welcome to React
React is a popular library used to create user interfaces. It was built at Facebook to
address some of the challenges associated with large-scale, data-driven websites.
When React was released in 2013, the project was initially viewed with some skepti‐
cism because the conventions of React are quite unique.
In an attempt to not intimidate new users, the core React team wrote an article called
“Why React?” that recommended that you “Give It [React] Five Minutes.” They
wanted to encourage people to work with React first before thinking that their
approach was too crazy.
Yes, React is a small library that doesn’t come with everything you might need out of
the box to build your application. Give it five minutes.
Yes, in React, you write code that looks like HTML right in your JavaScript. And yes,
those tags require preprocessing to run in a browser. And you’ll probably need a
build tool like webpack for that. Give it five minutes.
If you read that article—as we did—you may have been dazzled by the promise of a
new JavaScript library—a library that would solve all of our problems with the DOM;
a library that would always be easy to work with and would never hurt us.
Then the questions start to arise: how do I convert this JSX? How do I load data?
Where does the CSS go? What is declarative programming? Every path leads to more
questions about how to incorporate this library in your actual day to day work. Every
conversation introduces new terminology, new techniques, and more questions.
1
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of The Book of
the Thousand Nights and a Night — Volume 03
[Supplement]
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Language: English
—Arab Proverb.
—“Decameron”—conclusion.
“Erubuit, posuitque meum Lucretia librum
Sed coram Bruto. Brute! recede, leget.”
—Martial.
“Mieulx est de ris que de larmes escripre,
Pour ce que rire est le propre des hommes.”
—Rabelais.
“The pleasure we derive from perusing the Thousand-and-One
Stories makes us regret that we possess only a comparatively small
part of these truly enchanting fictions.”
—Crichton’s “History of Arabia.”
upplemental TO THE
BOOK OF THE ights
Thousand Nights and a Night
WITH NOTES ANTHROPOLOGICAL AND
EXPLANATORY
VOLUME III.
BY
RICHARD F. BURTON
Number ____
Printed in U. S. A.
TO
THIS
THE AUTHOR.
FOREWORD.
Sauerbrunn-Rohitsch, Styria.
Sept. 15, ’87.
CONTENTS OF THE THIRD VOLUME.
PAGE
By W. A. CLOUSTON.
PAGE
ADDITIONAL NOTES:—
The Tale of Zayn Al-Asnam 649
Aladdin; or the Wonderful Lamp 650
Ali Baba and the Forty Thieves 650
The Tale of Prince Ahmad 652
THE TALE OF ZAYN AL-ASNAM.
(ARABIC.)
Then Zayn al-Asnam grew up and increased until his age attained its
fifteenth year, when his sire the Sultan appointed for him an
experienced governor, one versed in all the sciences and
philosophies;[12] who fell to instructing him till such times as he
waxed familiar with every branch of knowledge, and in due season
he became an adult. Thereupon the Sultan bade summon his son
and heir to the presence together with the Lords of his land and the
Notables of his lieges and addressed him before them with excellent
counsel saying, “O my son, O Zayn al-Asnam, seeing that I be
shotten in years and at the present time sick of a sickness which
haply shall end my days in this world and which anon shall seat thee
in my stead, therefore, I bequeath unto thee the following charge.
Beware, O my son, lest thou wrong any man, and incline not to
cause the poor complain; but do justice to the injured after the
measure of thy might. Furthermore, have a care lest thou trust to
every word spoken to thee by the Great; but rather lend thou ever
an ear unto the voice of the general; for that thy Grandees will
betray thee as they seek only whatso suiteth them, not that which
suiteth thy subjects.” A few days after this time the old Sultan’s
distemper increased and his life-term was fulfilled and he died;
whereupon his son, Zayn al-Asnam, arose and donned mourning-
dress for his father during six days; and on the seventh he went
forth to the Divan and took seat upon the throne of his Sultanate.
He also held a levée wherein were assembled all the defenders of
the realm, and the Ministers and the Lords of the land came forward
and condoled with him for the loss of his parent and wished him all
good fortune and gave him joy of his kingship and dominion and
prayed for his endurance in honour and his permanence in
prosperity.——And Shahrazad was surprised by the dawn of day and
ceased to say her permitted say.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com