Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

4330 bites

Page 61

React Native1 min read

JSI, Fabric, and TurboModules in the New Architecture

JSI gives JS direct synchronous access to native via C++, Fabric is the new renderer, TurboModules lazy-load native modules.

React Native1 min read

Responsive Layouts with Core React Native APIs

Lean on flexbox, percentage sizing, useWindowDimensions, SafeAreaView, and Platform; recompute on dimension change.

React Native1 min read

Debouncing a Search TextInput with Hooks

Keep input in state, in an effect set a timer that fires the search after a delay, clear the timer on each change so only the final pause triggers the call.

React Native1 min read

Why react-native-gesture-handler Replaces the Responder System

The JS responder system runs on the JS thread so gestures lag under load; gesture-handler runs recognition natively for smooth, reliable gestures.

React Native1 min read

Fetching REST Data with Loading and Error State

Track loading, data, and error; fetch in an effect, check response.ok, parse JSON, handle catch and finally.

React Native1 min read

Draggable Snap-Back Card with Gesture Handler and Reanimated

Shared values track offset, a Pan gesture updates them on the UI thread, an animated style applies translation, onEnd springs back to zero.

React Native1 min read

Returning a Promise from a Native Module Method

The exported method takes resolve and reject as its last parameters; do the async work off the main thread, then settle exactly once with a result or an error.

React Native2 min read

ViewManager and Exposing Native Component Props

The ViewManager creates the native view and maps it to a JS component; you expose props with a prop-setter that receives the value when the prop changes.

React Native1 min read

Why the New Architecture Replaced the Bridge

The old bridge was async, serialized to JSON, and a single batched channel causing latency; JSI replaces it with direct synchronous C++ interop.

React Native1 min read

How Fabric Improves Rendering Over the Old UIManager

A C++ shadow tree shared across threads, JSI-based synchronous access, immutable tree commits, and support for concurrent React features.

React Native1 min read

CodeGen and Typed Scaffolding in the New Architecture

It reads typed JS specs and generates native interfaces at build time so JS and native agree on types, avoiding runtime checks and giving compile-time safety.

React Native1 min read

Unit testing a custom hook with renderHook

Render the hook, read result.current, fire actions inside act, assert updated state.

React Native1 min read

Layered testing strategy for a large RN app

Many fast Jest unit tests, fewer RNTL component tests on behavior, few Detox/Maestro E2E on critical flows.

React Native1 min read

Build flavors and schemes for RN environments

Android productFlavors with distinct applicationId and resources, iOS schemes plus configurations and targets, environment config injection.

React Native2 min read

Web DOM elements vs React Native core components

View maps to UIView/ViewGroup, Text to native text, no HTML or CSS, all text must be inside Text.

React Native2 min read

The legacy React Native Bridge architecture

JS, native, and shadow threads communicate via an async, batched, JSON-serialized Bridge.

React Native2 min read

Adding native code to Expo without ejecting

Use prebuild with config plugins to inject native changes, build a custom development client with EAS, keep native folders generated not hand-edited.

React Native2 min read

Composing tap and pan gestures together

Declare both gestures and relate them with simultaneous or exclusive composition, using Gesture.Race or simultaneousHandlers so a small move stays a tap.

React Native2 min read

Passing params between Stack Navigator screens

Navigate to the route with a params object, read it via route.params on the target, pass an id not a huge object.

React Native2 min read

Android-only native module called safely from JS

Write a ReactContextBaseJavaModule with an exported method, register it in a package, then guard the JS call with Platform.OS or a null check on the module.