Duncan Leung

React

01

Tackling 'on load' Scrolling in Chat Applications

reactDOM

How to solve one of the most frustrating UX issues in chat applications: ensuring automatic scrolling works correctly when images load asynchronously.

02

Why useRef Doesn't Work for Dynamic Element Measurements

reactDOM

Why useRef alone is insufficient for dynamic measurements, and how to combine it with ResizeObserver and useState for responsive UI.

03

Accessing Material UI Theme Object in Emotion JS

reactmaterial-uiemotion

A guide to access and utilize Material-UI theme objects within Emotion styled components and CSS props, with practical implementation examples.

04

Understanding useEffect: Each Render Has Its Own Props, State, and Effects

reacthooks

A mental model for useEffect: moving past the lifecycle (mount/update/unmount) mindset to thinking about effects as a way to synchronize side effects with React state and props.

05

useReducer: A Mental Model for Decoupling Actions from State Updates

reacthooks

When to reach for useReducer over useState, and why. The Dan Abramov framing: dispatch tells the reducer what happened, the reducer decides how state changes - so the component never needs to know the update logic.

06

Fixing React Warning: Synthetic Events in setState()

react

Understand and resolve React synthetic event warnings in setState, with best practices for event handling and state updates.

07

Pure render() 'this' Binding Patterns in React

reactperformance

A deep dive into React pure render optimization and method binding patterns, exploring different approaches for improving component performance.

08

webpack: Building React For Production on Windows

reactwebpack

A guide to configuring Webpack for building optimized React production bundles on Windows, including environment-specific settings and common pitfalls.

09

Avoiding React setState() Pitfalls

react

A guide to avoiding common pitfalls when using setState in React, including asynchronous updates, batching, and state management patterns.