BA

Babel Plugin Transform React Remove Prop Types

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

Remove unnecessary React propTypes from the production build

Utilities
babel
babel-plugin
react
minification
propTypes
babel-plugin-transform-react-remove-prop-types
Utilities
javascript
npm
frontend
Stars
598
Weekly
4.1M
Open issues
7
Bundle
~25 kB

Installation

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

Code example

import { useBabelPluginTransformReactRemovePropTypes } from "babel-plugin-transform-react-remove-prop-types";

export function Example() {
  const value = useBabelPluginTransformReactRemovePropTypes();
  return <p>{String(value)}</p>;
}

Pros & cons

Pros

  • Actively maintained by Nikita Gusakov
  • 4.1M weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~25 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 7 open issues on GitHub

FAQs

Alternatives & similar libraries