Skip to content
PluginStats

babel-plugin-transform-react-remove-prop-types weekly downloads statistics

By oliviertassinari (2 listings) · npm · Babel plugins

Remove unnecessary React propTypes from the production build

View on npm Fresh · Dec 6, 2026

babel-plugin-transform-react-remove-prop-types has 5,031,700 recorded weekly downloads on npm, a decrease of 2.5% over the past 30 days, ranking #166 of 3,247 tracked listings.

Weekly downloads
5,031,700
Official API · Dec 5, 2026
7-day growth
+7.6%
+353.4K weekly downloads
30-day growth
-2.5%
-130.1K weekly downloads
90-day growth
+23.3%
+952K weekly downloads
Rank
#166
▲ 1 in 7 days

About babel-plugin-transform-react-remove-prop-types

babel-plugin-transform-react-remove-prop-types

Remove unnecessary React propTypes from the production build.

npm version npm downloads Build Status

Dependencies DevDependencies

Installation

npm install --save-dev babel-plugin-transform-react-remove-prop-types

The problem solved

Remove React propTypes from the production build, as they are only used in development. You can save bandwidth by removing them.

Example

In

const Baz = (props) => (
  <div {...props} />
);

Baz.propTypes = {
  className: PropTypes.string
};

Out

const Baz = (props) => (
  <div {...props} />
);
With comment annotation

The majority of cases should be addressed by default by this plugin.

In some cases, for example when using HOCs (High Order Components), like react-redux's connect, or component inheritance (although it's NOT recommended), a comment after the propTypes definition may be used to force the removal:

Component.propTypes /* remove-proptypes */ = {}

Usage

Via .babelrc (Recommended)

.babelrc

without options:

{
  "env": {
    "production": {
      "plugins": ["transform-react-remove-prop-types"]
    }
  }
}

with options:

{
  "env": {
    "production": {
      "plugins": [
        ["transform-react-remove-prop-types", {
          "mode": "wrap",
          "ignoreFilenames": ["node_modules"]
        }]
      ]
    }
  }
}
Via CLI
babel --plugins transform-react-remove-prop-types script.js
Via Node API

without options:

require('babel-core').transform('code', {
  plugins: [
    'transform-react-remove-prop-types',
  ],
});

with options:

require('babel-core').transform('code', {
  plugins: [
    [
      'transform-react-remove-prop-types',
      {
        mode: 'wrap',
        ignoreFilenames: ['node_modules'],
      },
    ],
  ],
});

Options

mode
  • remove (default): the propTypes definitions are removed from the source code.
  • wrap: the propTypes definitions are wrapped with the following code:
Component.propTypes = process.env.NODE_ENV !== "production" ? {
  // ...
} : {};

Accessing Component.propTypes.className won't throw. It's a tradeoff between the size of the output file and the likelihood libraries like react-native-hyperlink breaks.

  • unsafe-wrap: the propTypes definitions are wrapped with the following code:
if (process.env.NODE_ENV !== "production") {
  Component.propTypes = {
    // ...
  }
}

Accessing Component.propTypes.className will throw.

The wrap modes are targeting React libraries like material-ui or react-native-web. They are not intended to be used by application authors.

removeImport
  • true: the import statements are removed as well. This option only works if mode is set to remove:
import PropTypes from 'prop-types'
  • false (default): does not remove the import statements.
ignoreFilenames

This filter generates a regular expression. Any filenames containing one of the array's strings will be ignored. By default, we match everything.

Following the Is it safe? section, you might encounter a component depending on the propTypes at runtime to work. For this reason, we provide an array options to filter out some files and folders. For instance, you can ignore all the npm modules:

ignoreFilenames: ['node_modules'],
additionalLibraries

This option gives the possibility to remove other propTypes in addition to the canonical prop-types.

For instance, by default

import PropTypes from 'prop-types'
import ImmutablePropTypes from 'react-immutable-proptypes'

will result in the latter not to be removed, while with:

additionalLibraries: ['react-immutable-proptypes'],

both will be removed.

Regular expressions

If you are using Babel 7 or newer and your config is stored in babel.config.js, you can also use a regular expression to describe modules, which should be removed.

This would be particularly useful when using custom prop types validators, implemented as part of your own source code. For example

import CustomPropTypes from '../../prop-types/my-own-validator'
import OtherCustomPropTypes from '../../prop-types/my-other-validator'

would be removed with the following setting

additionalLibraries: [/\/prop-types\/.*$/]

If you use an index file

import CustomPropTypes from '../../prop-types'

you could set it up as

additionalLibraries: [/\/prop-types$/]
classNameMatchers

Use this option to enable this plugin to run on components that extend a class different than React.Component or React.PureComponent.…

Description from the npm listing.

  • babel
  • babel-plugin
  • react
  • minification
  • propTypes

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

babel-plugin-transform-react-remove-prop-types weekly downloads on npm, last 90 days: 5,031,700 weekly downloads as of Dec 5, 2026, +23.3% over 90 days.babel-plugin-transform-react-remove-pr…Weekly downloads on npm · Last 90 days5,031,700downloads / week+23.3% over 90 days01M2M3M4M5M6M7M8MSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
babel-plugin-transform-react-remove-prop-types weekly downloads on npm, last 90 days: 5,031,700 weekly downloads as of Dec 5, 2026, +23.3% over 90 days.

7/30/90-day growth

babel-plugin-transform-react-remove-prop-types weekly downloads growth on npm: +7.6% over 7 days, -2.5% over 30 days, +23.3% over 90 days.babel-plugin-transform-react-remove-pr…Weekly downloads growth on npm5,031,700downloads / week now7-day growth+353,372 weekly downloads+7.6%30-day growth-130,080 weekly downloads-2.5%90-day growth+951,983 weekly downloads+23.3%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-react-remove-prop-types weekly downloads growth on npm: +7.6% over 7 days, -2.5% over 30 days, +23.3% over 90 days.

Ranking history

babel-plugin-transform-react-remove-prop-types npm ranking history: currently #166 (by weekly downloads).babel-plugin-transform-react-remove-pr…npm ranking · by weekly downloads · Last 90 days#166current rank#150#155#160#165#170Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-react-remove-prop-types npm ranking history: currently #166 (by weekly downloads).

Listing placement

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

Listing placement

Babel plugins263 listings · 14 pages · page 6, #15 (overall #115)
Babel 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 babel-plugin-transform-react-remove-prop-types
Date (UTC)Weekly downloadsChange vs. previous
5,031,700+12.7K
5,018,992+129.1K
4,889,918+150K
4,739,889+36.8K
4,703,090+45.6K
4,657,486-8.6K
4,666,103-12.2K
4,678,328-9.8K
4,688,093-120.1K
4,808,201-179.6K
4,987,762-74.4K
5,062,184+1.9K
5,060,272+11.7K
5,048,537—

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/babel-plugin-transform-react-remove-prop-types. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.