npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-render-queue

v0.1.0

Published

A performant render queue library for React Native that controls component rendering with configurable parallelism and shimmer placeholders

Readme

react-native-render-queue

A performant render queue library for React Native that controls component rendering with configurable parallelism and beautiful shimmer placeholders.

Features

  • Progressive Rendering - Control how many components render simultaneously
  • Priority Queue - Assign priorities to ensure critical content renders first
  • Shimmer Placeholders - Beautiful, animated loading placeholders out of the box
  • Zero Dependencies - Uses only React Native's built-in Animated API
  • TypeScript First - Full TypeScript support with comprehensive types
  • Lightweight - Minimal bundle size impact

Why Use Render Queue?

When a React Native screen has many complex components, rendering them all at once can cause:

  • Janky animations and transitions
  • Slow initial render times
  • Poor user experience on lower-end devices

react-native-render-queue solves this by:

  1. Queuing components to render progressively
  2. Limiting parallel renders to prevent frame drops
  3. Showing beautiful placeholders while content loads
  4. Allowing priority-based rendering for critical content

Installation

npm install react-native-render-queue
# or
yarn add react-native-render-queue

Quick Start

1. Wrap your app with the Provider

import { RenderQueueProvider } from 'react-native-render-queue';

function App() {
  return (
    <RenderQueueProvider config={{ maxParallelRenders: 2 }}>
      <MyScreen />
    </RenderQueueProvider>
  );
}

2. Wrap components with RenderQueueItem

import { RenderQueueItem, Shimmer } from 'react-native-render-queue';

function MyScreen() {
  return (
    <ScrollView>
      {/* Critical content - renders immediately */}
      <RenderQueueItem immediate>
        <Header />
      </RenderQueueItem>

      {/* These render progressively */}
      <RenderQueueItem placeholder={<Shimmer height={200} />}>
        <HeroImage />
      </RenderQueueItem>

      <RenderQueueItem priority={1} placeholder={<Shimmer height={100} />}>
        <FeaturedProducts />
      </RenderQueueItem>

      <RenderQueueItem priority={2} placeholder={<Shimmer height={300} />}>
        <RecommendationList />
      </RenderQueueItem>
    </ScrollView>
  );
}

API Reference

RenderQueueProvider

The context provider that manages the render queue.

<RenderQueueProvider config={config}>
  {children}
</RenderQueueProvider>

Config Options

| Property | Type | Default | Description | |----------|------|---------|-------------| | maxParallelRenders | number | 2 | Maximum components rendering simultaneously | | staggerDelay | number | 16 | Delay (ms) between starting each render | | defaultPlaceholder | ReactNode | null | Default placeholder for all queue items | | debug | boolean | false | Enable console logging for debugging |

RenderQueueItem

Wraps a component to be rendered through the queue.

<RenderQueueItem
  priority={0}
  placeholder={<Shimmer />}
  immediate={false}
  onRenderStart={() => console.log('Started')}
  onRenderComplete={() => console.log('Done')}
>
  <MyComponent />
</RenderQueueItem>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | children | ReactNode | Required | Content to render | | priority | number | 0 | Lower = higher priority | | placeholder | ReactNode | Config default | Loading placeholder | | immediate | boolean | false | Skip queue, render immediately | | onRenderStart | () => void | - | Called when rendering begins | | onRenderComplete | () => void | - | Called when rendering completes | | style | ViewStyle | - | Container style | | id | string | Auto-generated | Unique identifier |

useQueuedRender Hook

For custom control over queued rendering:

import { useQueuedRender } from 'react-native-render-queue';

function CustomComponent() {
  const { isReady, markComplete, queuePosition } = useQueuedRender({
    priority: 1,
  });

  useEffect(() => {
    if (isReady) {
      // Perform expensive work
      loadData().then(() => markComplete());
    }
  }, [isReady]);

  if (!isReady) {
    return <Shimmer />;
  }

  return <ActualContent />;
}

Shimmer Components

Shimmer

Basic animated shimmer placeholder:

<Shimmer
  width={200}
  height={100}
  borderRadius={8}
  backgroundColor="#E0E0E0"
  highlightColor="#F5F5F5"
  duration={1000}
  animated={true}
/>

ShimmerGroup

Multiple shimmer placeholders:

<ShimmerGroup
  count={5}
  gap={12}
  direction="vertical"
  shimmerProps={{ height: 60, borderRadius: 8 }}
/>

ShimmerTemplates

Pre-built templates for common UI patterns:

import { ShimmerTemplates } from 'react-native-render-queue';

// Card placeholder
<ShimmerTemplates.Card />

// List item with avatar
<ShimmerTemplates.ListItem />

// Profile header
<ShimmerTemplates.ProfileHeader />

// Text paragraph
<ShimmerTemplates.Paragraph lines={4} />

Advanced Usage

Setting Default Placeholder

<RenderQueueProvider
  config={{
    maxParallelRenders: 3,
    defaultPlaceholder: <Shimmer height={100} />,
  }}
>
  {/* All RenderQueueItems will use this placeholder by default */}
</RenderQueueProvider>

Priority-Based Rendering

// Priority 0 (highest) - renders first
<RenderQueueItem priority={0}>
  <CriticalContent />
</RenderQueueItem>

// Priority 1 - renders after priority 0
<RenderQueueItem priority={1}>
  <ImportantContent />
</RenderQueueItem>

// Priority 2 - renders last
<RenderQueueItem priority={2}>
  <SecondaryContent />
</RenderQueueItem>

Monitoring Queue Status

import { useRenderQueue } from 'react-native-render-queue';

function QueueMonitor() {
  const { getQueueStatus, config } = useRenderQueue();

  const status = getQueueStatus();
  const queued = status.filter(item => item.status === 'queued').length;
  const rendering = status.filter(item => item.status === 'rendering').length;
  const rendered = status.filter(item => item.status === 'rendered').length;

  return (
    <Text>
      Queue: {queued} | Rendering: {rendering} | Done: {rendered}
    </Text>
  );
}

Without Provider (Graceful Degradation)

Components work without the provider - they just render immediately:

// This will render immediately since there's no provider
<RenderQueueItem placeholder={<Shimmer />}>
  <MyComponent />
</RenderQueueItem>

Performance Tips

  1. Set appropriate maxParallelRenders

    • Lower values (1-2) for complex components
    • Higher values (3-4) for simpler components
    • Test on low-end devices
  2. Use priorities wisely

    • Priority 0 for above-the-fold content
    • Higher priorities for below-the-fold content
  3. Use immediate for critical content

    • Headers, navigation elements
    • Content users see first
  4. Match placeholder dimensions

    • Prevents layout shifts when content loads

TypeScript

Full TypeScript support included:

import type {
  RenderQueueConfig,
  RenderQueueItemProps,
  ShimmerProps,
  ShimmerGroupProps,
} from 'react-native-render-queue';

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library