SurviveJS - React
SurviveJS - React
From apprentice to master
About the Book
Facebook's React powers an increasing amount of sites. There is a good reason for this. It simplifies frontend development greatly.
SurviveJS - React shows you how to build a simple Kanban application based on these technologies. During the process you will learn to:
- Learn to understand the ideas behind React.
- Learn to design component hierarchies as you work on the application.
- Get into the React mindset while learning to think and manage state carefully.
- Style your React application in various emerging ways.
- Implement drag and drop for your application using React DnD.
In addition the Leanpub edition contains exclusive chapters showing you how to:
- Deal with typing in React.
- Test your React application in various ways.
The book assumes you know basics of JavaScript and understand how to use npm.
Most of the book content is available online at survivejs.com. By buying this book you support the development of further content.
Packages
The Book
The book in pdf, epub, mobi. The source code is available at https://github.com/survivejs/react.
English
PDF
EPUB
MOBI
WEB
One for a friend too
Get a copy for a friend as well. Includes two copies.
English
PDF
EPUB
MOBI
WEB
One for the team
Get copies for your team mates. Or friends. I don't discriminate. Includes four copies.
English
PDF
EPUB
MOBI
WEB
Bundles that include this book
About the Contributors

Jesús Rodríguez Rodríguez is a frontend developer who dedicates his time to moderate the official Angular.js IRC channel and he also gives support there.
He spent some time collaborating with organization like AngularUI and he also write in his blog (http://www.angular-tips.com) all about angular.
He also likes to edit / review books, that also includes writing his own books.
Reader Testimonials

Steve Piercy
SurviveJS connects the dots
SurviveJS connects the dots and fills the gaps left by the latest JavaScript tools and their documentation. With its detailed step-by-step tutorial approach, SurviveJS gives practical examples of code and configuration while providing context for choosing one method over another.

Nick Ostrovsky
Headstart to Webpack and React
This is the most useful book I’ve read this year. Apart from React itself it gives you a headstart into Webpack which is gaining traction as the weapon of choice for deploying Javascript apps and Flux architecture pattern. Well-written, full of annotated code, what’s not to like? Yes, I would recommend it to a friend.

Omar van Galen
Antidote for JavaScript Fatigue
Setting up a cutting-edge frontend development environment with React takes time. What sets SurviveJS apart is that it does not only show you exactly how to do it, it evolves, preventing JS fatigue, hence the name.

Phil Ledgerwood
Helping to get projects up and running
I originally got this book to learn React, but I found quickly that the instruction on Webpack alone was worth the price of admission. I have followed this book's iteration from very early on, and it gets better every time. It is very useful, and to this day I keep going back to it as a good way to get new projects up and running.
Table of Contents
-
-
Introduction
- What is React?
- What Will You Learn?
- How is This Book Organized?
- What is Kanban?
- Who is This Book for?
- How to Approach the Book?
- Book Versioning
- Extra Material
- Getting Support
- Announcements
- Acknowledgments
-
Introduction
-
I Getting Started
-
1. Introduction to React
- 1.1 What is React?
- 1.2 Virtual DOM
- 1.3 React Renderers
-
1.4
React.createElement
and JSX - 1.5 Conclusion
-
2. Setting Up the Project
- 2.1 Setting Up Node.js and Git
- 2.2 Running the Project
-
2.3 Boilerplate npm
scripts
- 2.4 Boilerplate Language Features
- 2.5 Conclusion
-
3. Implementing a Note Application
- 3.1 Initial Data Model
- 3.2 Rendering Initial Data
- 3.3 Generating the Ids
- 3.4 Adding New Notes to the List
- 3.5 Conclusion
-
4. Deleting
Notes
-
4.1 Separating
Note
-
4.2 Adding a Stub for
onDelete
Callback -
4.3 Communicating Deletion to
App
- 4.4 Conclusion
-
4.1 Separating
-
5. Understanding React Components
- 5.1 Lifecycle Methods
- 5.2 Refs
- 5.3 Custom Properties and Methods
- 5.4 React Component Conventions
- 5.5 Conclusion
-
6. Editing
Notes
-
6.1 Implementing
Editable
-
6.2 Extracting Rendering from
Note
-
6.3 Adding
Editable
Stub -
6.4 Connecting
Editable
withNotes
-
6.5 Tracking
Note
editing
State -
6.6 Implementing
Edit
- 6.7 On Namespacing Components
- 6.8 Conclusion
-
6.1 Implementing
-
7. Styling the Notes Application
- 7.1 Styling “Add Note” Button
-
7.2 Styling
Notes
- 7.3 Styling Individual Notes
- 7.4 Conclusion
-
1. Introduction to React
-
II Implementing Kanban
-
8. React and Flux
- 8.1 Quick Introduction to Redux
- 8.2 Quick Introduction to MobX
- 8.3 Which Data Management Solution to Use?
- 8.4 Introduction to Flux
- 8.5 Porting to Alt
-
8.6 Understanding
connect
- 8.7 Dispatching in Alt
- 8.8 Conclusion
-
9. Implementing
NoteStore
andNoteActions
-
9.1 Setting Up a
NoteStore
- 9.2 Understanding Actions
-
9.3 Setting Up
NoteActions
-
9.4 Connecting
NoteActions
withNoteStore
-
9.5 Porting
App.addNote
to Flux -
9.6 Porting
App.deleteNote
to Flux -
9.7 Porting
App.activateNoteEdit
to Flux -
9.8 Porting
App.editNote
to Flux - 9.9 Conclusion
-
9.1 Setting Up a
-
10. Implementing Persistency over
localStorage
-
10.1 Understanding
localStorage
-
10.2 Implementing a Wrapper for
localStorage
-
10.3 Persisting the Application Using
FinalStore
- 10.4 Implementing the Persistency Logic
- 10.5 Connecting Persistency Logic with the Application
-
10.6 Cleaning Up
NoteStore
- 10.7 Alternative Implementations
- 10.8 Relay?
- 10.9 Conclusion
-
10.1 Understanding
-
11. Handling Data Dependencies
-
11.1 Defining
Lanes
-
11.2 Connecting
Lanes
withApp
-
11.3 Modeling
Lane
-
11.4 Making
Lanes
Responsible ofNotes
-
11.5 Extracting
LaneHeader
fromLane
- 11.6 Conclusion
-
11.1 Defining
-
12. Editing Lanes
-
12.1 Implementing Editing for
Lane
names -
12.2 Implementing
Lane
Deletion - 12.3 Styling Kanban Board
- 12.4 Conclusion
-
12.1 Implementing Editing for
-
13. Implementing Drag and Drop
- 13.1 Setting Up React DnD
- 13.2 Allowing Notes to Be Dragged
- 13.3 Allowing Notes to Detect Hovered Notes
-
13.4 Developing
onMove
API forNotes
- 13.5 Adding Action and Store Method for Moving
- 13.6 Implementing Note Drag and Drop Logic
- 13.7 Dragging Notes to Empty Lanes
- 13.8 Conclusion
-
8. React and Flux
-
III Advanced Techniques
-
14. Testing React
- 14.1 Levels of Testing
- 14.2 Writing Your First Test
- 14.3 Understanding the Test Setup
- 14.4 Testing Kanban Components
-
14.5 Testing
Editable
-
14.6 Testing
Note
- 14.7 Testing Kanban Stores
- 14.8 Conclusion
-
15. Typing with React
-
15.1
propTypes
anddefaultProps
- 15.2 Typing Kanban
- 15.3 Type Checking with Flow
-
15.4 Converting
propTypes
to Flow Checks - 15.5 Babel Typecheck
- 15.6 TypeScript
- 15.7 Conclusion
-
15.1
-
16. Styling React
- 16.1 Old School Styling
- 16.2 CSS Methodologies
- 16.3 CSS Processors
- 16.4 React Based Approaches
- 16.5 CSS Modules
- 16.6 Conclusion
-
17. Structuring React Projects
- 17.1 Directory per Concept
- 17.2 Directory per Component
- 17.3 Directory per View
- 17.4 Conclusion
-
14. Testing React
-
Appendices
-
Language Features
- Modules
- Classes
- Class Properties and Property Initializers
- Functions
- String Interpolation
- Destructuring
- Object Initializers
-
const
,let
,var
- Decorators
- Conclusion
-
Understanding Decorators
- Implementing a Logging Decorator
-
Implementing
@connect
- Decorator Ideas
- Conclusion
-
Troubleshooting
-
EPEERINVALID
- Warning: setState(…): Cannot update during an existing state transition
- Warning: React attempted to reuse markup in a container but the checksum was invalid
-
Module parse failed
- Project Fails to Compile
-
-
Language Features
Authors have earned$9,882,857writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Functional Design and Architecture
Alexander GraninSoftware Design in Functional Programming, Design Patterns and Practices, Methodologies and Application Architectures. How to build real software in Haskell with less efforts and low risks. The first complete source of knowledge.
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
I am a Software Engineer and I am in Charge
Alexis Monville and Michael DoyleI am a Software Engineer and I am in Charge is a real-world, practical book that helps you increase your impact and satisfaction at work no matter who you work with.
In the book, we will follow Sandrine, a fictional character who learns to think in a new way enabling her to take a different course of action.
Invest In Digital Health - The Medical Futurist's Guide
Dr. Bertalan MeskoArtificial Intelligence and Digital Health are booming. In this book, we explain why now it's a good time to invest in Digital Health and give recommendations on where to invest by looking at the top 24 technological trends we find the most promising.
Atomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
The Hundred-Page Machine Learning Book
Andriy BurkovEverything you really need to know in Machine Learning in a hundred pages.
Mastering STM32
Carmine NovielloWith more than 600 microcontrollers, STM32 is probably the most complete ARM Cortex-M platform on the market. This book aims to be the first guide around that introduces the reader to this exciting MCU portfolio from ST Microelectronics and its official CubeHAL.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
The Future of Digital Health
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy and how technology giants such as Amazon or Google want to conquer... - #3
Cisco CCNA 200-301 Complet
4 Books
Ce lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301. - #4
CCDE Practical Studies (All labs)
3 Books
CCDE lab - #5
"The C++ Standard Library" and "Concurrency with Modern C++"
2 Books
Get my books "The C++ Standard Library" and "Concurrency with Modern C++" in a bundle. The first book gives you the details you should know about the C++ standard library; the second one dives deeper into concurrency with modern C++. In sum, you get more than 600 pages full of modern C++ and about 250 source files presenting the standard library... - #6
Modern Management Made Easy
3 Books
Read all three Modern Management Made Easy books. Learn to manage yourself, lead and serve others, and lead the organization. - #7
Programming with Ease
3 Books
Alle drei Bände der Serie Programming with Ease in einem Paket. Darin findest du alles, was ich dir zu den wichtigsten Phasen der Softwareentwicklung im Hinblick auf Clean Code Development für langfristig hohe Produktivität sagen kann.Im Band Slicing findest du die Anforderungsanalyse im Rahmen eines iterativ-inkrementellen Vorgehensmodells aus... - #8
Vagrant Ansible
2 Books
Unveil the power of Ansible and Vagrant with this bundle at a special price. You'll have everything you need to get started with Vagrant - learn the basics and how to create your virtual development environments, using Ansible as provisioner! About Vagrant Cookbook Vagrant Cookbook is a complete guide to get started with Vagrant and create your... - #9
Mastering Containers
2 Books
Docker and Kubernetes are taking the world by storm! These books will get you up-to-speed fast! Docker Deep Dive is over 400 pages long, and covers all objectives on the Docker Certified Associate exam.The Kubernetes Book includes everything you need to get up and running with Kubernetes! - #10
Growing Agile: The Complete Coach's Guide
7 Books
Growing Agile: Coach's Guide Series This bundle provides a collection of training and workshop plans for a variety of agile topics. The series is aimed at agile coaches, trainers and ScrumMasters who often find themselves needing to help teams understand agile concepts. Each book in the series provides the plans, slides, handouts and activity...