Search
Find a bite, explore a topic or look for a role.
Results for “React”
Bites 747
StatelessWidget: Flutter's Immutable UI Blueprint
A StatelessWidget is a 'frozen' UI blueprint, built once with its configuration and never changing its own state. Use it for static UI like icons or text labels. The footgun is using it for UI that must react to internal data changes.
Theme Provider Pattern: Centralized UI Styling
A Theme Provider acts like a global style guide, injecting design tokens like colors and fonts into all child components. It's used in frameworks like React to ensure a consistent look and feel. The footgun: components outside the provider won't get the theme.
Styled Components: CSS-in-JS as Components
Think of your styles as React components. Styled Components uses JavaScript template literals to write CSS in your JS, creating components with encapsulated styles. It's ideal for building design systems where styles change based on props.
Media Queries: CSS That Adapts to the User's Device
Instead of one-size-fits-all CSS, media queries let your styles react to the user's device. They are used to change layouts for different screen widths, orientations, or display resolutions. The footgun is only testing for width, ignoring other factors.

Build Dependency Management: Your Project's Recipe
Dependency management is your project's recipe, ensuring everyone uses the same library versions. It's used everywhere from web apps pulling React via npm to Java services using Maven.

Compose UI Testing: Find Nodes, Assert State, Perform Actions
Compose UI tests treat your UI as a node tree. You find nodes by properties (like text or a test tag), assert their state (e.g., 'is displayed'), and perform actions like clicks. Use it to verify composables react correctly to state changes or user input.
Leading vs. Lagging Indicators: Looking Forward vs. Backward
Leading indicators predict the future; lagging indicators confirm the past. This distinction is key for analyzing business cycles or system health. The main footgun is relying only on lagging data, forcing you to react to problems that have already occurred.
Server Components, explained without the jargon
React Server Components render on the server and send the client a description of the result, not JavaScript. That means no bundle cost for server rendered parts and direct database access, with client components handling only the interactive pieces.
SVG icons versus icon fonts: technical trade-offs
SVG is vector markup, crisp, multicolor, accessible, and tree-shakeable; icon fonts ship as glyphs, risk anti-aliasing blur, accessibility hacks, and load-failure boxes. Advocate SVG for modern apps.
Building a scalable icon system in Figma
Standardize a grid, size, and stroke; make each icon a component with consistent naming, use currentColor-friendly single-color paths, and export optimized SVGs.
Runtime CSS-in-JS performance pitfalls in SSR Next.js
Runtime libs serialize styles per render, need style collection on the server, risk FOUC and double work in App Router.
Fabric UI update lifecycle vs old architecture
Render builds an immutable C++ shadow tree, commit diffs trees and runs Yoga layout, mount applies mutations to native views; JSI shares the tree, enabling synchronous and concurrent rendering unlike the…
TurboModule lazy loading vs eager startup
Legacy modules are instantiated eagerly at launch; TurboModules initialize only when JS first accesses them, so unused modules cost nothing at startup.
What JSI is and how it replaces the Bridge
JSI is a lightweight C++ layer letting JS hold references to native host objects and call them directly and synchronously, with no JSON serialization or async batched queue.
TurboModules and lazy loading benefits
TurboModules use JSI for direct, synchronous, type-safe calls and are loaded lazily on first use instead of all at startup, cutting init time.
Threading of native module methods
Methods run on a dedicated native module queue, not the UI thread; long blocking work stalls other module calls; offload to a background executor or override methodQueue, returning results via promise.
Offline data storage and sync strategy
Persist locally in SQLite or WatermelonDB, queue mutations with a pending flag, detect reconnection with NetInfo, then replay the queue and resolve conflicts.
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.
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.
Build flavors and schemes for RN environments
Android productFlavors with distinct applicationId and resources, iOS schemes plus configurations and targets, environment config injection.