Reintroducing React
Reintroducing React
Modern React with Every React Update Since v16 Demystified (includes advanced hooks)
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:
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 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 earnedover $14 millionwriting, 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