tezvyn:

React Native

React Native, Expo, native modules, cross-platform

298 bites

More in React Native — page 9

React Native2 min read

Handling Network Errors in React Native

Network errors are normal state, not bugs to silence. In React Native, every fetch should expect flakiness and surface a retry path. The footgun is treating a timeout as permanent failure and wiping optimistic local state.

React Native2 min read

React Native State Persistence

React Native state dies when the OS kills your app. Persistence writes critical data to disk so users resume where they left off. The footgun is testing with a swipe-close instead of a real process kill, or restoring stale data without schema checks.

React Native2 min read

useAnimatedGestureHandler: UI-Thread Gesture Worklets

useAnimatedGestureHandler bridges RNGH events to Reanimated shared values on the UI thread via worklets, keeping pan gestures at 60fps without JS drops. The footgun is reading JS state inside worklet, which crashes because worklets run in an isolated runtime.

React Native2 min read

Composing Gestures: Race, Simultaneous, Exclusive

Gesture composition lets multiple detectors negotiate one touch stream. Use it when a view must scroll and pinch together. The footgun is assuming gestures cooperate by default; without explicit composition, one steals the stream and breaks the rest.

React Native2 min read

React Native Gesture Handler: Native-Driven Touch

React Native Gesture Handler moves touch recognition to the native thread so gestures stay smooth when JavaScript is busy. Use it for swipeable cards and bottom sheets. The footgun is using it without Reanimated, gaining complexity without the frame-rate win.

React Native2 min read

Debugging React Native Performance

React Native drops frames when the JS thread overloads, not just from bad code. Complex re-renders, console.log statements, or dev mode freeze touches and animations. Never trust performance numbers from development builds; always test in release mode.

Adaptive React Native UIs for Tablets and Foldables
React Native2 min read

Adaptive React Native UIs for Tablets and Foldables

Adaptive UI is context-aware layout, not just stretching pixels. It matters when a phone app hits a tablet or a foldable unfolds. Most devs stop at flexbox and wonder why the tablet experience still feels like a blown-up phone.

React Native2 min read

React Native's Platform Build Glue

React Native integrates into Android via Gradle files. You edit settings.gradle and both build.gradle files to wire the React Native Gradle Plugin and enable autolinking. The footgun: editing the wrong build.gradle breaks native modules silently.

React Native2 min read

Touchable Components in React Native

TouchableOpacity and siblings wrap views to give press feedback by dimming or highlighting. Use them for simple taps on buttons or list items. They inject extra Animated.View nodes that can silently break layout, and Pressable has superseded the entire family.

Appium: Test Your React Native App Like a Real User
React Native2 min read

Appium: Test Your React Native App Like a Real User

Appium tests your app like a real user, tapping and scrolling on actual devices to catch bugs your unit tests miss. It's for verifying full user flows across iOS and Android. The footgun: relying only on unit tests gives a false sense of security.

React Native2 min read

React Native's Bridgeless Mode

Bridgeless Mode replaces React Native's legacy message queue with direct calls between JavaScript and native code. This improves performance by removing the serialization bottleneck for UI rendering and native module calls.

useSyncExternalStore: For Synchronous External State
React Native2 min read

useSyncExternalStore: For Synchronous External State

`useSyncExternalStore` lets React safely read from external data sources without UI tearing. It's for integrating non-React state, like from Redux or browser APIs, ensuring consistent reads during concurrent rendering.

React Native2 min read

React Native's New Architecture Interop Layer

The Interop Layer is a compatibility bridge, letting legacy native modules run in React Native's New Architecture without a full rewrite. Library maintainers must ensure compatibility for users on RN 0.74+. The footgun: remove partial Codegen specs.

React Native2 min read

React Native Codegen: Bridging JS and Native

React Native's Codegen auto-generates the boilerplate 'glue code' connecting your JavaScript specs to native implementations. It's essential for building Turbo Modules and Fabric Components.

React Native2 min read

Android ViewManager: Bridging Native UI to React Native

A ViewManager is a factory for native Android UI. It tells React Native how to create and update a native view from JavaScript, bridging the gap between JS and native platform widgets. It's used for custom or third-party UI.

React Native2 min read

React Native: Sending Events from Native to JavaScript

Think of it as a webhook from native code to your JavaScript UI. Native modules can push updates to JS without being called, enabling reactive UIs for long-running tasks or platform-level events.

React Native2 min read

React Native: Creating an iOS Native Module

An iOS Native Module is a bridge, letting your JavaScript code call directly into native Objective-C or Swift. Use it to access platform APIs unavailable in React Native or for performance-critical tasks.

React Native2 min read

React Native's Two Threads: JS and UI

React Native splits work between a JS thread for React logic and a UI thread for drawing pixels, keeping the app responsive. The JS thread runs your code and calculates layout, while the UI thread handles native view updates.

React Native2 min read

React Native Secure Storage: Using Keychain and Keystore

Use the device's native vault (Keychain/Keystore) to store secrets, not plaintext in AsyncStorage. It's for securely persisting small data like API tokens or private keys. The footgun is treating it like a general database; it's slow and for secrets only.

React Native2 min read

React Native Geolocation: The Web API on Mobile

Think of it as the web's `navigator.geolocation` API for your native app. Use it for map features or location-based content. The biggest footgun on iOS is forgetting location usage descriptions in `Info.plist`, which causes silent permission failures.