Reintroducing React
Reintroducing React
Free!
Minimum price
$16.00
Suggested price
Reintroducing React

This book is 100% complete

Completed on 2019-05-16

About the Book

I wrote my first React application 3 to 4 years ago. Between then and now, the fundamental principles of React have remained the same. React is just as declarative and component-based today as it was then. 

That’s great news, however, the way we write React applications today has changed! 

There’s been a lot of new additions (and well, removals).

If you learned React a while back it’s not impossible that you haven’t been up to date with every new feature/release. It’s also possible to get lost on all the new features. Where exactly do you start? How important are they for your day to day use? 

Modern React has new interesting features that are worth your attention. It’s best to know those now, and not have to unlearn and relearn newer concepts. 

Whether you’ve been writing React for a while, or new to developing React applications, I will be discussing **every** update to React since version 16.

This will keep you in sync with the recent changes to React, and help you write better software. 

Remember, a reintroduction to React is important for not just beginners, but professionals alike. It all depends on how well you’ve kept your ear to the ground, and really studied the many changes that have been released over the last 12 months. 

On the bright side, I’m bringing you a one-stop reference to all the changes. From the new lifecycle methods to advanced hooks and reusable component patterns with hooks.

In this book, I’ll take you on a journey — alongside some humour and unique content to follow. 

The question is, are you ready to go on this journey with me? 

Got questions? Drop me a line at:

  • ohans@ohansemmanuel.me

Or follow me on twitter:

About the Author

Ohans Emmanuel
Ohans Emmanuel

Ohans Emmanuel is a Software Engineer. He's authored over 4 books, and he's a Medium top writer in technology. He believes anyone can learn new technologies if we are willing to teach it like 5-year olds.

Table of Contents

Preface 

Introduction

Why Comic Strips ? 

Why Reintroduce React ? 

What’s Changed since version 16? 


Chapter 1: New Lifecycle Methods.

What’s Lifecycle Anyway.

Lifecycle Methods.

static getDerivedStateFromProps. 

getSnapshotBeforeUpdate. 

The Error Handling Lifecycle Methods.

static getDerivedStateFromError.

componentDidCatch.

Conclusion.


Chapter 2: Simpler State Management with the Context API. 

Introduction to Context.

Example: The Mini-Bank Application.

Identifying Props being Drilled.

Avoid Props Drilling with Context.

Isolating Implementation Details.

Updating Context Values. 

Conclusion. 


Chapter 3: ContextType — Using Context without a Consumer. 

Using a Class Component with contextType.

The Perfect Solution? 

Conclusion


Chapter 4: React.memo === Functional PureComponent.

How React.memo works. 

Handling Deeply Nested Props. 

Conclusion. 


Chapter 5: The Profiler — Identifying Performance Bottlenecks.

Measuring Performance in React Apps. 

Getting Started. 

How does the Profiler Work?

Making Sense of the Profiler Results. 

The Flame Chart. 

The Ranked Chart. 

Component Chart. 

Interactions. 

Example: Identifying Performance BottleNecks in the Bank Application.

Noting the Expected Behaviour.

Interpreting the Flame chart.

Profile Different Interactions. 

The Provider Value. 

Conclusion. 


Chapter 6: Lazy Loading with React.Lazy and Suspense.

What is Lazy Loading? 

Using React.lazy and Suspense. 

Handling Errors. 

No named exports.

Code splitting routes.

Example: Adding Lazy Loading to the Bank App. 

Conclusion.


Chapter 7: Hooks — Building Simpler React Apps.

Introducing Hooks. 

The Candy Bowl.

The State Hook. 

Multiple useState calls.

Object as Initial Values 

The Effect Hook.

Passing Array Dependencies.

Build Your own Hooks

The Rules of Hooks

Advanced Hooks


Chapter 8: Advanced React Patterns with Hooks 

Introduction 

Why Advanced Patterns? 

Compound Components Pattern

Example: Building an Expanding Component. 

Designing the API 

Building the Expandable Component 

Building the Compound Child Components 

Manageable Styling for Reusable Components 

Building a Custom Hook 

Props Collection 

Prop Getters 

State Initializers 

State Reducer 

Control Props 

Conclusion 



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. Free App. 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), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). 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

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! 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. It really is that easy.

Learn more about writing on Leanpub