build/rnpm.js
function deprecatedComponent(message) {
    var methods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
    return function deprecatedComponentHOC(Component) {
      var _temp;

      return _temp =
      /*#__PURE__*/
      function (_React$Component) {
        _inherits(DeprecatedComponent, _React$Component);

        function DeprecatedComponent() {
          var _getPrototypeOf2;

          var _this;

          _classCallCheck(this, DeprecatedComponent);

          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }

          _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DeprecatedComponent)).call.apply(_getPrototypeOf2, [this].concat(args)));

          _defineProperty(_assertThisInitialized(_this), "onRef", function (ref) {
            return _this.ref = ref;
          });

          methods.forEach(function (name) {
            // delegate methods to the component
            _this[name] = function () {
              var _this$ref;

              return _this.ref && (_this$ref = _this.ref)[name].apply(_this$ref, arguments);
            };
          });
          return _this;
        }

        _createClass(DeprecatedComponent, [{
          key: "render",
          value: function render() {
            return React__default.createElement(Component, _extends({}, this.props, {
              ref: this.onRef
            }));
          }
        }, {
          key: "componentDidMount",
          value: function componentDidMount() {
            console.warn(message);
          }
        }]);

        return DeprecatedComponent;
      }(React__default.Component), _temp;
    };
  }
function deprecatedComponent(message) {
    var methods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
    return function deprecatedComponentHOC(Component) {
      var _temp;

      return _temp =
      /*#__PURE__*/
      function (_React$Component) {
        _inherits(DeprecatedComponent, _React$Component);

        function DeprecatedComponent() {
          var _getPrototypeOf2;

          var _this;

          _classCallCheck(this, DeprecatedComponent);

          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }

          _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DeprecatedComponent)).call.apply(_getPrototypeOf2, [this].concat(args)));

          _defineProperty(_assertThisInitialized(_this), "onRef", function (ref) {
            return _this.ref = ref;
          });

          methods.forEach(function (name) {
            // delegate methods to the component
            _this[name] = function () {
              var _this$ref;

              return _this.ref && (_this$ref = _this.ref)[name].apply(_this$ref, arguments);
            };
          });
          return _this;
        }

        _createClass(DeprecatedComponent, [{
          key: "render",
          value: function render() {
            return React__default.createElement(Component, _extends({}, this.props, {
              ref: this.onRef
            }));
          }
        }, {
          key: "componentDidMount",
          value: function componentDidMount() {
            console.warn(message);
          }
        }]);

        return DeprecatedComponent;
      }(React__default.Component), _temp;
    };
  }
function deprecatedComponent ( message ) { var methods = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : [ ] ; return function deprecatedComponentHOC ( Component ) { var _temp ; return _temp = /*#__PURE__*/ function ( _React$Component ) { _inherits ( DeprecatedComponent , _React$Component ) ; function DeprecatedComponent ( ) { var _getPrototypeOf2 ; var _this ; _classCallCheck ( this , DeprecatedComponent ) ; for ( var _len2 = arguments . length , args = new Array ( _len2 ) , _key2 = 0 ; _key2 < _len2 ; _key2 ++ ) { args [ _key2 ] = arguments [ _key2 ] ; } _this = _possibleConstructorReturn ( this , ( _getPrototypeOf2 = _getPrototypeOf ( DeprecatedComponent ) ) . call . apply ( _getPrototypeOf2 , [ this ] . concat ( args ) ) ) ; _defineProperty ( _assertThisInitialized ( _this ) , "onRef" , function ( ref ) { return _this . ref = ref ; } ) ; methods . forEach ( function ( name ) { // delegate methods to the component _this [ name ] = function ( ) { var _this$ref ; return _this . ref && ( _this$ref = _this . ref ) [ name ] . apply ( _this$ref , arguments ) ; } ; } ) ; return _this ; } _createClass ( DeprecatedComponent , [ { key : "render" , value : function render ( ) { return React__default . createElement ( Component , _extends ( { } , this . props , { ref : this . onRef } ) ) ; } } , { key : "componentDidMount" , value : function componentDidMount ( ) { console . warn ( message ) ; } } ] ) ; return DeprecatedComponent ; } ( React__default . Component ) , _temp ; } ; }
Higher order component to deprecate usage of component.
message - deprecate warning message
methods - array of method names to be delegated to deprecated component
Higher order component to deprecate usage of component . message - deprecate warning message methods - array of method names to be delegated to deprecated component