2016-10-17 15:40:11 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
2016-11-21 01:49:21 +00:00
|
|
|
'use strict';
|
2016-10-17 15:40:11 +00:00
|
|
|
|
|
|
|
module.exports = moduleName => {
|
|
|
|
const RealComponent = require.requireActual(moduleName);
|
|
|
|
const React = require('react');
|
|
|
|
|
|
|
|
const Component = class extends RealComponent {
|
|
|
|
render() {
|
2016-10-28 17:56:58 +00:00
|
|
|
const name = RealComponent.displayName || RealComponent.name;
|
|
|
|
|
2016-10-17 15:40:11 +00:00
|
|
|
return React.createElement(
|
2017-07-13 02:22:43 +00:00
|
|
|
name.replace(/^(RCT|RK)/,''),
|
2016-10-17 15:40:11 +00:00
|
|
|
this.props,
|
|
|
|
this.props.children,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
return Component;
|
|
|
|
};
|