module.exports = function ({Transformer}) {
  return new Transformer('minification.removeReactPropTypes', {
    Property: {
      exit(node) {
        if (node.computed || node.key.name !== 'propTypes') {
          return;
        }

        const parent = this.findParent((parent) => {
          return parent.type === 'CallExpression';
        });

        if (parent && parent.get('callee').matchesPattern('React.createClass')) {
          if (this.dangerouslyRemove) {
            this.dangerouslyRemove();
          } else {
            this.remove();
          }
        }
      }
    }
  });
};

@@ -1,109 +1,70 @@
-module.exports = function (%7BTransformer%7D) %7B%0A  return new Transformer('minification.removeReactPropTypes',
+export default function (%7B Plugin, types: t %7D) %7B%0A  const visitor =
  %7B%0A 
@@ -397,20 +397,16 @@
         
-if (
 this.dan
@@ -419,30 +419,28 @@
 lyRemove
-) %7B%0A  
+();%0A
         
   this.d
@@ -435,111 +435,134 @@
     
-  this.dangerouslyRemove();
+%7D
 %0A      
+%7D%0A
     %7D
- else %7B%0A            this.remove();%0A          %7D%0A        %7D%0A      %7D
+%0A  %7D;%0A%0A  return new Plugin('react-remove-prop-types', %7B%0A    visitor,%0A    metadata: %7B%0A      group: 'builtin-pre'
 %0A   

Migrate to new plugin api