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.

8664 bites

Page 8

React Native1 min read

Unit testing vs component testing in React Native

Unit tests verify isolated functions/logic with Jest; component tests render components and assert behavior with React Native Testing Library.

React Native1 min read

Why use a C++ TurboModule, and what are the risks?

C++ JSI bindings give synchronous, serialization-free calls and shared cross-platform code; challenges are manual memory ownership across the JS-C++ boundary, GC interaction, and thread safety.

React Native1 min read

What do the spec file and CodeGen do in migration?

The spec file declares the component's typed props and events; CodeGen reads it at build time to generate type-safe C++/native and JS glue, catching mismatches early.

React Native1 min read

What are the three pillars of the New Architecture?

JSI for direct JS-native calls, Fabric as the new renderer, and TurboModules for lazy native modules, all unified by CodeGen for type-safe bindings.

React Native1 min read

Direct events vs bubbling events in native components

Direct events fire only on the originating component; bubbling events propagate up the component tree like the DOM, allowing parent capture.

React Native1 min read

Contrast the legacy bridge with JSI

Bridge is async, serialized JSON, and batched; JSI enables direct synchronous C++ calls with no serialization, cutting latency and enabling lazy native modules.

React Native1 min read

What data types cross the bridge, and their limits?

Only JSON-serializable types cross — strings, numbers, booleans, null, arrays, maps; functions and native object handles cannot. Handle complex data via ids, base64, or JSI host objects.

React Native1 min read

How do you send a one-off event from native to JS?

Emit an event from native using an event emitter and subscribe in JS with NativeEventEmitter, or resolve a promise/callback for a single result.

React Native1 min read

How do you debug a memory leak with Hermes heap snapshots?

Take a baseline snapshot, exercise the suspect flow repeatedly, snapshot again, and compare retained sizes and object counts that grow monotonically.

React Native1 min read

How do you move a 500ms blocking task off the JS thread?

Offload to a native module or C++ TurboModule, a worklet/worker thread, or chunk the work and yield; never block JS.

React Native1 min read

How do Fabric, TurboModules, and JSI fix bridge limits?

JSI lets JS hold C++ host objects and call native synchronously without JSON serialization; Fabric renders concurrently and TurboModules lazy-load.

React Native1 min read

What is bridge traffic and what causes dropped frames?

The bridge passes batched, serialized JSON messages between JS and native asynchronously; high-frequency events flood it.

React Native1 min read

Which two Flipper plugins diagnose an unresponsive UI?

Use the React DevTools profiler to find expensive renders and the Performance/Hermes plugin to spot a blocked JS thread or low FPS.

React Native1 min read

What is Hermes and its advantages over JSC?

Hermes is an open-source engine optimized for RN, with faster startup via precompiled bytecode and lower memory use.

React Native1 min read

useMemo and useCallback for stable references

UseMemo caches a computed value, useCallback caches a function identity across renders; both prevent recompute and unnecessary re-renders of memoized children.

React Native2 min read

Cost of console.log and production-safe debugging

Each console.log serializes data and, when devtools are attached, crosses the bridge synchronously, blocking the JS thread; strip logs in release and use Flipper, dev tools, or remote crash and analytics tools.

React Native2 min read

FlatList and list virtualization

Use FlatList (or SectionList) which virtualizes, rendering only items near the viewport and recycling as you scroll, unlike ScrollView which mounts everything.

React Native2 min read

The JS thread and why it bottlenecks performance

A single thread runs your JS, React reconciliation, and event handling; blocking it delays updates and gestures, and it is separate from the UI thread.

React Native2 min read

Streaming accelerometer data without bridge overload

The bottleneck is flooding the async bridge and re-rendering at sensor rate; fix by throttling, processing in worklets or native, and animating via shared values not setState.

React Native2 min read

Handling push notifications across app states

Foreground onMessage, background and quit setBackgroundMessageHandler and getInitialNotification, plus data-only messages and native background tasks like Background Fetch or Notification Service…