Leanpub Header

Skip to main content

SurviveJS - React

From apprentice to master

SurviveJS - React shows you how to build a simple Kanban using React. The idea is that if you can build a simple application, you can probably build something more complex after that. The first application is always the hardest and that's where this book comes in.

In addition to fundamental React knowledge, you will pick up design techniques as you develop the application step by step and learn to understand it in detail.

Minimum price

$15.99

$15.99

You pay

$15.99

Author earns

$12.79

Packages

Details
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
2,621
Readers
257
Pages
39,382Words
About

About

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.

Share this book

License

Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License

Packages

Pick Your Package

All packages include the ebook in the following formats: PDF, EPUB, and Web

The Book

Minimum price

Suggested price$15.99

The book in pdf, epub, mobi. The source code is available at https://github.com/survivejs/react.

$15.99

    One for a friend too

    Minimum price

    Suggested price$27.99

    Get a copy for a friend as well. Includes two copies.

    $27.99

      This book is also available in the following packages:

      • One for the team

        Get copies for your team mates. Or friends. I don't discriminate. Includes four copies.

        Minimum price
        $49.99
        Suggested price
        $49.99

      Author

      About the Author

      Juho Vepsäläinen

      Juho Vepsäläinen is behind the SurviveJS effort. In addition to being a core developer of webpack, I have been active in the open source scene since the early 2000s. Blue Arrow Awards winner.

      Translations

      Translations

      Languages

      Contents

      Table of Contents

      Introduction

      1. What is React?
      2. What Will You Learn?
      3. How is This Book Organized?
      4. What is Kanban?
      5. Who is This Book for?
      6. How to Approach the Book?
      7. Book Versioning
      8. Extra Material
      9. Getting Support
      10. Announcements
      11. Acknowledgments
      12. IGetting Started

      1.Introduction to React

      1. 1.1What is React?
      2. 1.2Virtual DOM
      3. 1.3React Renderers
      4. 1.4React.createElement and JSX
      5. 1.5Conclusion

      2.Setting Up the Project

      1. 2.1Setting Up Node.js and Git
      2. 2.2Running the Project
      3. 2.3Boilerplate npm scripts
      4. 2.4Boilerplate Language Features
      5. 2.5Conclusion

      3.Implementing a Note Application

      1. 3.1Initial Data Model
      2. 3.2Rendering Initial Data
      3. 3.3Generating the Ids
      4. 3.4Adding New Notes to the List
      5. 3.5Conclusion

      4.Deleting Notes

      1. 4.1Separating Note
      2. 4.2Adding a Stub for onDelete Callback
      3. 4.3Communicating Deletion to App
      4. 4.4Conclusion

      5.Understanding React Components

      1. 5.1Lifecycle Methods
      2. 5.2Refs
      3. 5.3Custom Properties and Methods
      4. 5.4React Component Conventions
      5. 5.5Conclusion

      6.Editing Notes

      1. 6.1Implementing Editable
      2. 6.2Extracting Rendering from Note
      3. 6.3Adding Editable Stub
      4. 6.4Connecting Editable with Notes
      5. 6.5Tracking Note editing State
      6. 6.6Implementing Edit
      7. 6.7On Namespacing Components
      8. 6.8Conclusion

      7.Styling the Notes Application

      1. 7.1Styling “Add Note” Button
      2. 7.2Styling Notes
      3. 7.3Styling Individual Notes
      4. 7.4Conclusion
      5. IIImplementing Kanban

      8.React and Flux

      1. 8.1Quick Introduction to Redux
      2. 8.2Quick Introduction to MobX
      3. 8.3Which Data Management Solution to Use?
      4. 8.4Introduction to Flux
      5. 8.5Porting to Alt
      6. 8.6Understanding connect
      7. 8.7Dispatching in Alt
      8. 8.8Conclusion

      9.Implementing NoteStore and NoteActions

      1. 9.1Setting Up a NoteStore
      2. 9.2Understanding Actions
      3. 9.3Setting Up NoteActions
      4. 9.4Connecting NoteActions with NoteStore
      5. 9.5Porting App.addNote to Flux
      6. 9.6Porting App.deleteNote to Flux
      7. 9.7Porting App.activateNoteEdit to Flux
      8. 9.8Porting App.editNote to Flux
      9. 9.9Conclusion

      10.Implementing Persistency over localStorage

      1. 10.1Understanding localStorage
      2. 10.2Implementing a Wrapper for localStorage
      3. 10.3Persisting the Application Using FinalStore
      4. 10.4Implementing the Persistency Logic
      5. 10.5Connecting Persistency Logic with the Application
      6. 10.6Cleaning Up NoteStore
      7. 10.7Alternative Implementations
      8. 10.8Relay?
      9. 10.9Conclusion

      11.Handling Data Dependencies

      1. 11.1Defining Lanes
      2. 11.2Connecting Lanes with App
      3. 11.3Modeling Lane
      4. 11.4Making Lanes Responsible of Notes
      5. 11.5Extracting LaneHeader from Lane
      6. 11.6Conclusion

      12.Editing Lanes

      1. 12.1Implementing Editing for Lane names
      2. 12.2Implementing Lane Deletion
      3. 12.3Styling Kanban Board
      4. 12.4Conclusion

      13.Implementing Drag and Drop

      1. 13.1Setting Up React DnD
      2. 13.2Allowing Notes to Be Dragged
      3. 13.3Allowing Notes to Detect Hovered Notes
      4. 13.4Developing onMove API for Notes
      5. 13.5Adding Action and Store Method for Moving
      6. 13.6Implementing Note Drag and Drop Logic
      7. 13.7Dragging Notes to Empty Lanes
      8. 13.8Conclusion
      9. IIIAdvanced Techniques

      14.Testing React

      1. 14.1Levels of Testing
      2. 14.2Writing Your First Test
      3. 14.3Understanding the Test Setup
      4. 14.4Testing Kanban Components
      5. 14.5Testing Editable
      6. 14.6Testing Note
      7. 14.7Testing Kanban Stores
      8. 14.8Conclusion

      15.Typing with React

      1. 15.1propTypes and defaultProps
      2. 15.2Typing Kanban
      3. 15.3Type Checking with Flow
      4. 15.4Converting propTypes to Flow Checks
      5. 15.5Babel Typecheck
      6. 15.6TypeScript
      7. 15.7Conclusion

      16.Styling React

      1. 16.1Old School Styling
      2. 16.2CSS Methodologies
      3. 16.3CSS Processors
      4. 16.4React Based Approaches
      5. 16.5CSS Modules
      6. 16.6Conclusion

      17.Structuring React Projects

      1. 17.1Directory per Concept
      2. 17.2Directory per Component
      3. 17.3Directory per View
      4. 17.4Conclusion
      5. Appendices

      Language Features

      1. Modules
      2. Classes
      3. Class Properties and Property Initializers
      4. Functions
      5. String Interpolation
      6. Destructuring
      7. Object Initializers
      8. const, let, var
      9. Decorators
      10. Conclusion

      Understanding Decorators

      1. Implementing a Logging Decorator
      2. Implementing @connect
      3. Decorator Ideas
      4. Conclusion

      Troubleshooting

      1. EPEERINVALID
      2. Warning: setState(…): Cannot update during an existing state transition
      3. Warning: React attempted to reuse markup in a container but the checksum was invalid
      4. Module parse failed
      5. Project Fails to Compile

      Contributor

      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.

      The Leanpub 60 Day 100% Happiness Guarantee

      Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

      Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

      You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

      So, there's no reason not to click the Add to Cart button, is there?

      See full terms...

      Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

      We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

      (Yes, some authors have already earned much more than that on Leanpub.)

      In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

      Learn more about writing on Leanpub

      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) and EPUB (for phones, tablets and 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

      Write and Publish on Leanpub

      You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

      Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

      Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

      Learn more about writing on Leanpub