Fixes Components with prefixes in mock

Reviewed By: bestander

Differential Revision: D4096027

fbshipit-source-id: 342677a27c6d03dc7d2d6eb53970a504fb62d63b
This commit is contained in:
Cristian Carlesso 2016-10-28 10:56:58 -07:00 committed by Facebook Github Bot
parent 4cff039d78
commit 45275e30b9
2 changed files with 6 additions and 4 deletions

View File

@ -13,8 +13,10 @@ module.exports = moduleName => {
const Component = class extends RealComponent { const Component = class extends RealComponent {
render() { render() {
const name = RealComponent.displayName || RealComponent.name;
return React.createElement( return React.createElement(
RealComponent.displayName || RealComponent.name, name.replace(/^(RTC|RK)/,''),
this.props, this.props,
this.props.children, this.props.children,
); );

View File

@ -132,13 +132,13 @@ const mockNativeModules = {
width: 750, width: 750,
}, },
}, },
RCTModalFullscreenView: { ModalFullscreenView: {
Constants: {}, Constants: {},
}, },
RCTScrollView: { ScrollView: {
Constants: {}, Constants: {},
}, },
RCTView: { View: {
Constants: {}, Constants: {},
}, },
}, },