Search
Find a bite, explore a topic or look for a role.
Results for “React”
Bites 747
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.
Unit testing a custom hook with renderHook
Render the hook, read result.current, fire actions inside act, assert updated state.
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.
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.
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.
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.
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.
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.
StyleSheet.create and Inline Style Tradeoffs
Styles are JS objects of subset-CSS properties; StyleSheet.create validates them and yields stable references, while inline objects allocate each render.
Limits of OTA Updates and Runtime Versions
OTA ships only JS and assets; native changes need a store build; runtime versions gate compatibility.
Optimizing Slow iOS CI Build Times
Profile the build, cache CocoaPods and DerivedData, use prebuilt frameworks, parallelize, scope to changed work.
Over-the-Air Updates for JavaScript-Only Fixes
Ship a new JS bundle the app downloads at runtime and applies on next launch, with no store review.
Android App Bundles versus Universal APKs
An AAB is an upload format; Play generates per-device APKs via dynamic delivery, shrinking download size.
iOS Provisioning Profiles and Signing Certificates
The certificate proves developer identity, the App ID names the app, the profile binds certificate, App ID, and devices.
RNTL or Detox for a navigation flow?
RNTL can test navigation logic by rendering the navigator in JS and asserting screen changes; Detox runs the real app for true end-to-end confidence including native transitions.
What does 'test behavior, not implementation' mean?
Query elements the way a user finds them (text, role, label) and assert observable behavior; for a Button, fire press and assert the visible effect, not internal state.
How do you test a component using a native module?
Native code is absent in the Node-based Jest environment, so you mock the module with jest.mock to return fake values, often via the library's provided jest mock.
How do you mock a fetch call in Jest tests?
Replace global fetch with a Jest mock or a library like jest-fetch-mock, return a resolved Promise with a fake Response, and reset mocks between tests.
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.
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.