React Native · Mobile UI at native speed

How do you handle images and static assets?

MediumimagesassetscachingUpdated Oct 2026
Quiz this track

Short answer

Bundle small static assets through require or import, load remote images by URI, request correctly sized images, and use a caching image component for lists and feeds. Set explicit dimensions to avoid layout jumps.

React Native's Image component accepts a local asset from require or an object with a uri. Local assets are bundled by Metro and resolve to platform resources. Remote images are downloaded at runtime, and the default behaviour does not give you fine-grained cache control.

tsx
import { Image } from "react-native";

const logo = require("./assets/logo.png");

export function Avatar({ uri }: { uri: string }) {
  return (
    <Image
      source={{ uri }}
      style={{ width: 48, height: 48, borderRadius: 24 }}
      resizeMode="cover"
      accessibilityLabel="User avatar"
    />
  );
}
Explicit width and height prevent the layout from shifting after the image loads.

Practical asset rules

  • Request server-side resized images instead of downloading full-resolution photos
  • Use a caching image library for feeds and repeated remote images
  • Prefer WebP or platform-efficient formats where supported
  • Provide 2x and 3x assets, or vector icons, instead of one oversized bitmap
  • Set accessibilityLabel for meaningful images and mark decorative ones as not accessible

Large local assets increase download size and startup memory. Optimise them during the build, and avoid shipping multi-megabyte PNGs for icons. For icons, a vector icon library is usually smaller and sharper than raster sets.

The default Image cache is managed by the platform. If you need predictable cache keys, disk limits or prefetching, choose a library that exposes those controls.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1How does require differ from a uri source?
  2. 2How do you prevent layout shift when images load?
  3. 3What image format should you ship?
  4. 4How do you cache remote images?

Say it in the interview

I bundle small static assets with require and load remote images by URI, always with explicit dimensions so the layout does not jump. I request appropriately sized images from the backend and use a caching image component in feeds. For icons I prefer vectors over large bitmaps, and I add accessibility labels for meaningful images.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live React Native mock interview and get scored feedback on depth, clarity and confidence.