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-render-profiler

v0.2.0

Published

React render profiling via Profiler API with debounced aggregated reporting

Readme

React Render Profiler

Profiler helpers built on React's <Profiler> callback with debounced aggregation output.

Install

npm i react-render-profiler

What It Gives You

  • Render samples from React actualDuration and baseDuration
  • Aggregated reporting with debounce (reportAfterMs)
  • Three integration styles:
    • withRenderProfiler(Component, options?)
    • <RenderProfiler id="...">...</RenderProfiler>
    • useRenderProfiler(componentName, options?)

By default profiling is disabled in production (NODE_ENV === "production").

Usage

HOC

import { withRenderProfiler } from 'react-render-profiler';

const ProfiledCard = withRenderProfiler(ProductCard, {
  componentName: 'ProductCard',
  groupByComponent: true,
  reportAfterMs: 1000,
});

Wrapper Component

import { RenderProfiler } from 'react-render-profiler';

export function ProductSection() {
  return (
    <RenderProfiler id="ProductSection" groupByComponent reportAfterMs={1000}>
      <ProductList />
    </RenderProfiler>
  );
}

Hook (manual <Profiler> placement)

import { Profiler } from 'react';
import { useRenderProfiler } from 'react-render-profiler';

export function CheckoutSidebar() {
  const { profilerId, onRender, enabled } = useRenderProfiler('CheckoutSidebar', {
    reportAfterMs: 1000,
  });

  if (!enabled) {
    return <aside>...</aside>;
  }

  return (
    <Profiler id={profilerId} onRender={onRender}>
      <aside>...</aside>
    </Profiler>
  );
}

API

RenderProfilerOptions<P>

  • componentName?: string
  • reportAfterMs?: number (default 500)
  • groupByComponent?: boolean (default false)
  • log?: (rows: LogPayload[]) => void (default console.table sink)
  • enabled?: boolean | ((props: P) => boolean)

LogPayload

  • componentName
  • renders
  • mountPhases
  • updatePhases
  • totalActualMs
  • minActualMs
  • maxActualMs
  • totalBaseMs

withRenderProfiler(Component, options?)

Wraps a component in <Profiler>, supporting enabled as boolean or predicate function.

RenderProfiler

Component form:

<RenderProfiler id="MySection">{children}</RenderProfiler>

useRenderProfiler(componentName, options?)

Returns { profilerId, onRender, enabled } for manual <Profiler> usage.