Mastering React’s Stable Values
In React, a stable value is one that keeps its identity across renders: state setters from useState/useReducer and refs from useRef are stable, while inline arrays, objects and anonymous functions are recreated on every render. Unstable values break hooks that take dependency lists (useEffect, useCallback, useMemo) and APIs like React Navigation's useFocusEffect, which will unsubscribe and resubscribe on every render unless its callback is wrapped in useCallback. Rendering an inline helper function as a JSX component makes React see a new component type each render, so it tears down and remounts the whole subtree, which is costly in React Native. The fixes are to call such helpers directly or define components at module scope, and to use useCallback selectively, mainly for props passed to React.memo components.
Related posts
- Why I Still Use jQuery
Docker mediumAdeptjQuery remains a reasonable choice in 2025 for specific cases: maintaining legacy apps where rewrites cost more than they return, build-free prototypes loaded from a CDN, older embedded browsers like kiosks and intranets, simple chained animations, and servers that return HTML fragments, where `.load()` replaces fetch-plus-DOMParser boilerplate. It should be avoided in React/Vue-style component apps, where direct DOM changes bypass the virtual DOM and cause state bugs. It is also unnecessary for modern-browser-only projects, where native `querySelectorAll`, `fetch`, `classList` and `element.animate` cover its core features. Lighter alternatives such as Cash, Umbrella JS, Axios, delegate-it and GSAP can replace individual pieces.
- The uphill climb of making diff lines performant
GitHub Engineering mediumAdeptGitHub rebuilt the React diff-line components in the pull request Files changed tab after large PRs pushed the JavaScript heap past 1 GB, DOM counts above 400,000 and INP to unusable levels. The v2 design cut per-line React components from eight to two, replaced per-line event handlers with a single top-level handler keyed on data attributes, and moved commenting and menu state into conditionally rendered children. It also confined useEffect to the file level and switched to O(1) Map-based lookups. On a 10,000-line split diff this cut rendered components by 74%, memory by about 50% and INP from ~450 ms to ~100 ms. For p95+ PRs, TanStack Virtual windowing gave a 10x heap and DOM reduction and 40–80 ms INP, supplemented by cheaper CSS selectors, GPU transforms, partial hydration and progressive diff loading.
- How Migrating from Vanilla Redux to Redux Toolkit Improved State Management in Shopify POS
Shopify Engineering mediumAdeptShopify's Point of Sale React Native app moved from vanilla Redux to Redux Toolkit over about three months. The team migrated reducer by reducer, relying on RTK slices and vanilla reducers coexisting in one root reducer so each change could ship and roll back independently. They adopted RTK's mutable slice syntax and generated action creators widely. For async logic they kept a hybrid createAsyncThunk pattern instead of extraReducers pending/fulfilled handlers, and skipped RTK Query because it lacks GraphQL support. The migration deleted about 3,500 lines of boilerplate, and the post flags two gotchas: type useDispatch, useSelector and useStore early, and use dispatch().unwrap() where code previously awaited dispatch.
- How We Built the Add to Favorite Animation in Shop
Shopify Engineering mediumAdeptShop's Add to Favorite animation, where a product thumbnail pops in, scales, and drops into a bouncing heart tab-bar icon, is built in React Native with Reanimated by driving the whole sequence from a single shared progress value that steps through 1, 2, 3 and so on, each step with its own duration and easing from the motion spec. Each property (opacity, scale, translateY, icon fill and bounce) is mapped from that progress value with clamped interpolation, and the filled heart is a second icon faded in over the outline. Using one shared value guarantees the icon moves the instant the thumbnail disappears, creating a cinematic match cut. An earlier setTimeout-based approach broke that timing when the JS thread was busy; Reanimated's withDelay keeps the timer on the UI thread.
- Migrating to React Native's New Architecture
Shopify Engineering mediumAdeptShopify moved Shopify Mobile and POS to React Native's New Architecture (Fabric) without pausing weekly releases. The team kept both architectures buildable on every PR, made only minimal code changes, deferred TurboModule conversion of 40+ native modules, and upgraded to the latest React Native first. Common breakages included state batching exposing timing-dependent components, blank screens caused by UIManager-dependent modules, view flattening nulling refs (fixed with collapsable={false} and a Babel plugin), and main-thread module setup deadlocks. A staged Android-first rollout with stability-based rollback tiers yielded 10% faster Android launch, though crash-free sessions and ANRs regressed for weeks after release.