Skip to content
PluginStats

rolldown-plugin-react-forward-ref weekly downloads statistics

By diegohaz · npm · Vite plugins

Transform React ref props into forwardRef components for React 18 with Rolldown and Vite.

View on npm Fresh · Dec 6, 2026

rolldown-plugin-react-forward-ref has 4,559 recorded weekly downloads on npm, a decrease of 63.4% over the past 30 days, ranking #1566 of 3,247 tracked listings.

Weekly downloads
4,559
Official API · Dec 5, 2026
7-day growth
-49.1%
-4.4K weekly downloads
30-day growth
-63.4%
-7.9K weekly downloads
90-day growth
—
Insufficient history
Rank
#1566
▼ 281 in 7 days

About rolldown-plugin-react-forward-ref

rolldown-plugin-react-forward-ref

Run selected React 19-style function components on React 18. The plugin adds forwardRef wrappers at module initialization and passes the received ref to the original function as a prop. It supports indirect forwarding:

export function Button(props: ButtonProps) {
  const [variantProps, rest] = splitProps(props, button);
  return <BaseButton {...button.jsx(variantProps)} {...rest} />;
}

The ref reaches splitProps before the function reads props. There is no extra React element around the original function, and wrappers keep their identity across renders. This package adapts ref transport only. It does not polyfill other React 19 features.

Install it as a development dependency:

pnpm add -D rolldown-plugin-react-forward-ref

API and file selection

import reactForwardRef from "rolldown-plugin-react-forward-ref";

reactForwardRef({
  include: ["src/components/**/*.tsx", "src/examples/**/*.tsx"],
  exclude: ["**/*.test.tsx", "**/legacy/**"],
});

include is required and must be a non-empty glob, regular expression, or array of those patterns. exclude accepts the same forms and takes priority. Globs use @rollup/pluginutils and resolve relative to process.cwd(). Paths use forward slashes on all platforms. There are no project-specific path defaults.

Only .js, .jsx, .ts, .tsx, .mjs, .mts, .cjs, .cts, are eligible. Declaration files, virtual modules, node_modules, and Vite ?raw/?url requests are always excluded. JSX in JavaScript files is parsed; the host must also be configured to lower JSX for the selected extension. Other query suffixes are removed before matching. Input must be an ES module; the plugin does not convert CommonJS module exports.

There is one default export for Rolldown, Vite, and Vitest. The plugin uses a transform hook, with order: "pre" and Vite's enforce: "pre". It runs before TypeScript/JSX lowering, in both development and builds. Put it before other plugins with pre-transform hooks, including @vitejs/plugin-react. Already lowered JSX cannot be detected.

Version selection belongs to the consumer configuration. The plugin does not read a React version or enable itself automatically.

Rolldown

import { defineConfig } from "rolldown";
import reactForwardRef from "rolldown-plugin-react-forward-ref";

export default defineConfig({
  input: "src/index.tsx",
  plugins: [reactForwardRef({ include: "src/components/**/*.tsx" })],
  external: /^react(?:\/|$)/,
  output: { dir: "dist", format: "esm", sourcemap: true },
});

Vite

import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import reactForwardRef from "rolldown-plugin-react-forward-ref";

export default defineConfig({
  plugins: [reactForwardRef({ include: "src/components/**/*.tsx" }), react()],
});

React 18-only Vitest configuration

Read the version from the test workspace's dependency graph. An isolated React 18 workspace must install matching React and React DOM versions.

import react from "@vitejs/plugin-react";
import { version } from "react";
import { defineConfig } from "vitest/config";
import reactForwardRef from "rolldown-plugin-react-forward-ref";

export default defineConfig({
  plugins: [
    version.startsWith("18.") &&
      reactForwardRef({
        include: ["src/ui/**/*.tsx", "src/examples/**/*.tsx"],
      }),
    react(),
  ],
  test: { environment: "jsdom" },
});

For projects that alias React, use an explicit target flag instead if the configuration's react import does not resolve to the test runtime. Disable the plugin for React 19 to retain its native behavior. The test suite also checks adapted output on React 19, with the no-ref semantics below.

Component selection

Within each selected file, the plugin selects top-level function declarations and const function initializers with an ASCII uppercase first letter and JSX in their own function body. A default-exported function can have any name or be anonymous, except names with the hook prefix use followed by an uppercase letter or digit. JSX in nested functions or classes does not count. A visible ref read is not required. Hooks and ordinary lowercase utilities stay unchanged.

This is a syntax rule, not proof that a function is a React component. Limit the file filters to component source. A PascalCase utility with JSX that otherwise meets the rule is indistinguishable from a component. Functions used as direct calls, constructors, .call/.apply/.bind targets, or arguments to opaque functions are conservatively left unchanged. This also protects render functions passed to existing forwardRef calls or custom HOCs. Local identifier aliases are followed; this conservative check can also skip a same-named binding in another scope.…

Description from the npm listing.

  • forwardref
  • react
  • react18
  • rolldown
  • rolldown-plugin
  • vite
  • vite-plugin

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

rolldown-plugin-react-forward-ref weekly downloads on npm, last 90 days: 4,559 weekly downloads as of Dec 5, 2026.rolldown-plugin-react-forward-refWeekly downloads on npm · Last 90 days4,559downloads / week02K4K6K8K10K12K14KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
rolldown-plugin-react-forward-ref weekly downloads on npm, last 90 days: 4,559 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

rolldown-plugin-react-forward-ref weekly downloads growth on npm: -49.1% over 7 days, -63.4% over 30 days, 90-day growth unavailable.rolldown-plugin-react-forward-refWeekly downloads growth on npm4,559downloads / week now7-day growth-4,403 weekly downloads-49.1%30-day growth-7,893 weekly downloads-63.4%90-day growth+4,559 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
rolldown-plugin-react-forward-ref weekly downloads growth on npm: -49.1% over 7 days, -63.4% over 30 days, 90-day growth unavailable.

Ranking history

rolldown-plugin-react-forward-ref npm ranking history: currently #1566 (by weekly downloads).rolldown-plugin-react-forward-refnpm ranking · by weekly downloads · Last 90 days#1566current rank#1000#1100#1200#1300#1400#1500#1600Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
rolldown-plugin-react-forward-ref npm ranking history: currently #1566 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 79, #6 (overall #1,566)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 14, #12 (overall #272)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for rolldown-plugin-react-forward-ref
Date (UTC)Weekly downloadsChange vs. previous
4,559-925
5,484-33
5,517+282
5,235-160
5,395-518
5,913-1.8K
7,693-1.3K
8,962+101
8,861-2K
10,909+111
10,798-525
11,323-647
11,970+1.2K
10,820—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/rolldown-plugin-react-forward-ref. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.