2016-10-17 15:40:11 +00:00
|
|
|
/**
|
2021-12-30 23:08:43 +00:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2016-10-17 15:40:11 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2018-05-11 20:32:37 +00:00
|
|
|
*
|
|
|
|
* @format
|
2016-10-17 15:40:11 +00:00
|
|
|
*/
|
2018-05-11 20:32:37 +00:00
|
|
|
|
2016-10-17 15:40:11 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-10-18 22:24:15 +00:00
|
|
|
const MockNativeMethods = jest.requireActual('./MockNativeMethods');
|
|
|
|
const mockComponent = jest.requireActual('./mockComponent');
|
2016-10-17 15:40:11 +00:00
|
|
|
|
2022-12-06 02:34:33 +00:00
|
|
|
jest.requireActual('@react-native/js-polyfills/Object.es8');
|
|
|
|
jest.requireActual('@react-native/js-polyfills/error-guard');
|
2016-10-17 15:40:11 +00:00
|
|
|
|
|
|
|
global.__DEV__ = true;
|
|
|
|
|
2020-07-09 18:38:27 +00:00
|
|
|
global.performance = {
|
|
|
|
now: jest.fn(Date.now),
|
|
|
|
};
|
|
|
|
|
2018-10-18 22:24:15 +00:00
|
|
|
global.regeneratorRuntime = jest.requireActual('regenerator-runtime/runtime');
|
2021-08-24 16:40:39 +00:00
|
|
|
global.window = global;
|
2016-10-17 15:40:11 +00:00
|
|
|
|
2021-11-03 05:10:46 +00:00
|
|
|
global.requestAnimationFrame = function (callback) {
|
2023-01-23 17:53:01 +00:00
|
|
|
return setTimeout(() => callback(jest.now()), 0);
|
2017-05-05 00:29:09 +00:00
|
|
|
};
|
2021-11-03 05:10:46 +00:00
|
|
|
global.cancelAnimationFrame = function (id) {
|
2017-05-05 00:29:09 +00:00
|
|
|
clearTimeout(id);
|
|
|
|
};
|
|
|
|
|
2016-10-17 15:40:11 +00:00
|
|
|
// there's a __mock__ for it.
|
2019-05-08 13:56:35 +00:00
|
|
|
jest.setMock(
|
|
|
|
'../Libraries/vendor/core/ErrorUtils',
|
|
|
|
require('../Libraries/vendor/core/ErrorUtils'),
|
|
|
|
);
|
2016-10-17 15:40:11 +00:00
|
|
|
|
|
|
|
jest
|
2019-05-08 13:56:35 +00:00
|
|
|
.mock('../Libraries/Core/InitializeCore', () => {})
|
2020-03-20 03:29:05 +00:00
|
|
|
.mock('../Libraries/Core/NativeExceptionsManager', () => ({
|
|
|
|
__esModule: true,
|
|
|
|
default: {
|
|
|
|
reportException: jest.fn(),
|
|
|
|
},
|
|
|
|
}))
|
2019-05-31 10:12:46 +00:00
|
|
|
.mock('../Libraries/ReactNative/UIManager', () => ({
|
|
|
|
AndroidViewPager: {
|
|
|
|
Commands: {
|
|
|
|
setPage: jest.fn(),
|
|
|
|
setPageWithoutAnimation: jest.fn(),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
blur: jest.fn(),
|
|
|
|
createView: jest.fn(),
|
|
|
|
customBubblingEventTypes: {},
|
|
|
|
customDirectEventTypes: {},
|
|
|
|
dispatchViewManagerCommand: jest.fn(),
|
|
|
|
focus: jest.fn(),
|
2020-03-25 04:35:58 +00:00
|
|
|
getViewManagerConfig: jest.fn(name => {
|
2019-05-31 10:12:46 +00:00
|
|
|
if (name === 'AndroidDrawerLayout') {
|
|
|
|
return {
|
|
|
|
Constants: {
|
|
|
|
DrawerPosition: {
|
|
|
|
Left: 10,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}),
|
2021-01-26 22:01:50 +00:00
|
|
|
hasViewManagerConfig: jest.fn(name => {
|
2021-05-01 00:39:43 +00:00
|
|
|
return name === 'AndroidDrawerLayout';
|
2021-01-26 22:01:50 +00:00
|
|
|
}),
|
2019-05-31 10:12:46 +00:00
|
|
|
measure: jest.fn(),
|
|
|
|
manageChildren: jest.fn(),
|
|
|
|
removeSubviewsFromContainerWithID: jest.fn(),
|
|
|
|
replaceExistingNonRootView: jest.fn(),
|
|
|
|
setChildren: jest.fn(),
|
|
|
|
updateView: jest.fn(),
|
|
|
|
AndroidDrawerLayout: {
|
|
|
|
Constants: {
|
|
|
|
DrawerPosition: {
|
|
|
|
Left: 10,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
AndroidTextInput: {
|
|
|
|
Commands: {},
|
|
|
|
},
|
|
|
|
ScrollView: {
|
|
|
|
Constants: {},
|
|
|
|
},
|
|
|
|
View: {
|
|
|
|
Constants: {},
|
|
|
|
},
|
|
|
|
}))
|
2019-05-08 13:56:35 +00:00
|
|
|
.mock('../Libraries/Image/Image', () =>
|
|
|
|
mockComponent('../Libraries/Image/Image'),
|
|
|
|
)
|
|
|
|
.mock('../Libraries/Text/Text', () =>
|
|
|
|
mockComponent('../Libraries/Text/Text', MockNativeMethods),
|
|
|
|
)
|
|
|
|
.mock('../Libraries/Components/TextInput/TextInput', () =>
|
2020-03-19 18:38:45 +00:00
|
|
|
mockComponent('../Libraries/Components/TextInput/TextInput', {
|
|
|
|
...MockNativeMethods,
|
|
|
|
isFocused: jest.fn(),
|
|
|
|
clear: jest.fn(),
|
|
|
|
getNativeRef: jest.fn(),
|
|
|
|
}),
|
2019-05-08 13:56:35 +00:00
|
|
|
)
|
2021-10-08 05:42:56 +00:00
|
|
|
.mock('../Libraries/Modal/Modal', () => {
|
|
|
|
const baseComponent = mockComponent('../Libraries/Modal/Modal');
|
|
|
|
const mockModal = jest.requireActual('./mockModal');
|
|
|
|
return mockModal(baseComponent);
|
|
|
|
})
|
2019-05-08 13:56:35 +00:00
|
|
|
.mock('../Libraries/Components/View/View', () =>
|
|
|
|
mockComponent('../Libraries/Components/View/View', MockNativeMethods),
|
|
|
|
)
|
2019-05-31 10:12:46 +00:00
|
|
|
.mock('../Libraries/Components/AccessibilityInfo/AccessibilityInfo', () => ({
|
2021-04-09 00:34:51 +00:00
|
|
|
__esModule: true,
|
|
|
|
default: {
|
|
|
|
addEventListener: jest.fn(),
|
|
|
|
announceForAccessibility: jest.fn(),
|
2021-10-30 01:39:38 +00:00
|
|
|
isAccessibilityServiceEnabled: jest.fn(),
|
2021-04-09 00:34:51 +00:00
|
|
|
isBoldTextEnabled: jest.fn(),
|
|
|
|
isGrayscaleEnabled: jest.fn(),
|
|
|
|
isInvertColorsEnabled: jest.fn(),
|
|
|
|
isReduceMotionEnabled: jest.fn(),
|
2022-08-25 17:45:15 +00:00
|
|
|
prefersCrossFadeTransitions: jest.fn(),
|
2021-04-09 00:34:51 +00:00
|
|
|
isReduceTransparencyEnabled: jest.fn(),
|
|
|
|
isScreenReaderEnabled: jest.fn(() => Promise.resolve(false)),
|
|
|
|
setAccessibilityFocus: jest.fn(),
|
2022-07-18 22:19:53 +00:00
|
|
|
sendAccessibilityEvent: jest.fn(),
|
2021-04-09 00:34:51 +00:00
|
|
|
getRecommendedTimeoutMillis: jest.fn(),
|
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
}))
|
2022-09-16 15:54:05 +00:00
|
|
|
.mock('../Libraries/Components/Clipboard/Clipboard', () => ({
|
|
|
|
getString: jest.fn(() => ''),
|
|
|
|
setString: jest.fn(),
|
|
|
|
}))
|
2019-05-08 13:56:35 +00:00
|
|
|
.mock('../Libraries/Components/RefreshControl/RefreshControl', () =>
|
|
|
|
jest.requireActual(
|
|
|
|
'../Libraries/Components/RefreshControl/__mocks__/RefreshControlMock',
|
|
|
|
),
|
|
|
|
)
|
Make ScrollView use ForwardRef
Summary:
Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`.
Previous usage:
```
const myRef = React.createRef<React.ElementRef<typeof ScrollView>>();
<ScrollView ref={myRef} />
const innerViewRef = myRef.current.getNativeScrollRef();
innerViewRef.measure();
```
New usage:
```
const myRef = React.createRef<React.ElementRef<typeof View>>();
<ScrollView ref={myRef} />
// now, myRef.current can be used directly as the ref
myRef.current.measure();
myRef.current.measureLayout();
// Additionally, myRef still has access to ScrollView methods
myRef.current.scrollTo(...);
```
Changes:
* Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder`
* Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`.
* Forwarded the ref to the native scroll view using `setAndForwardRef`.
* Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed.
* Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView.
* Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref.
* Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call.
* Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc).
Changes to mockScrollView:
* Changed mockScrollView to be able to mock the function component instead of a class component
* Updated necessary tests
Changelog:
[General] [Changed] - Make ScrollView use forwardRef
Reviewed By: TheSavior
Differential Revision: D19304480
fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4
2020-03-26 23:47:39 +00:00
|
|
|
.mock('../Libraries/Components/ScrollView/ScrollView', () => {
|
|
|
|
const baseComponent = mockComponent(
|
|
|
|
'../Libraries/Components/ScrollView/ScrollView',
|
|
|
|
{
|
|
|
|
...MockNativeMethods,
|
|
|
|
getScrollResponder: jest.fn(),
|
|
|
|
getScrollableNode: jest.fn(),
|
|
|
|
getInnerViewNode: jest.fn(),
|
|
|
|
getInnerViewRef: jest.fn(),
|
|
|
|
getNativeScrollRef: jest.fn(),
|
|
|
|
scrollTo: jest.fn(),
|
|
|
|
scrollToEnd: jest.fn(),
|
|
|
|
flashScrollIndicators: jest.fn(),
|
|
|
|
scrollResponderZoomTo: jest.fn(),
|
|
|
|
scrollResponderScrollNativeHandleToKeyboard: jest.fn(),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
const mockScrollView = jest.requireActual('./mockScrollView');
|
|
|
|
return mockScrollView(baseComponent);
|
|
|
|
})
|
2023-01-04 02:09:06 +00:00
|
|
|
.mock('../Libraries/Components/ActivityIndicator/ActivityIndicator', () => ({
|
|
|
|
__esModule: true,
|
|
|
|
default: mockComponent(
|
2019-05-08 13:56:35 +00:00
|
|
|
'../Libraries/Components/ActivityIndicator/ActivityIndicator',
|
2023-01-04 02:09:06 +00:00
|
|
|
null,
|
|
|
|
true,
|
2019-05-08 13:56:35 +00:00
|
|
|
),
|
2023-01-04 02:09:06 +00:00
|
|
|
}))
|
2019-05-31 10:12:46 +00:00
|
|
|
.mock('../Libraries/AppState/AppState', () => ({
|
2021-02-06 07:18:51 +00:00
|
|
|
addEventListener: jest.fn(() => ({
|
|
|
|
remove: jest.fn(),
|
|
|
|
})),
|
2019-05-31 10:12:46 +00:00
|
|
|
}))
|
|
|
|
.mock('../Libraries/Linking/Linking', () => ({
|
|
|
|
openURL: jest.fn(),
|
|
|
|
canOpenURL: jest.fn(() => Promise.resolve(true)),
|
|
|
|
openSettings: jest.fn(),
|
|
|
|
addEventListener: jest.fn(),
|
|
|
|
getInitialURL: jest.fn(() => Promise.resolve()),
|
|
|
|
sendIntent: jest.fn(),
|
|
|
|
}))
|
|
|
|
// Mock modules defined by the native layer (ex: Objective-C, Java)
|
|
|
|
.mock('../Libraries/BatchedBridge/NativeModules', () => ({
|
|
|
|
AlertManager: {
|
|
|
|
alertWithArgs: jest.fn(),
|
2018-12-30 21:28:22 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
AsyncLocalStorage: {
|
|
|
|
multiGet: jest.fn((keys, callback) =>
|
|
|
|
process.nextTick(() => callback(null, [])),
|
|
|
|
),
|
|
|
|
multiSet: jest.fn((entries, callback) =>
|
|
|
|
process.nextTick(() => callback(null)),
|
|
|
|
),
|
|
|
|
multiRemove: jest.fn((keys, callback) =>
|
|
|
|
process.nextTick(() => callback(null)),
|
|
|
|
),
|
|
|
|
multiMerge: jest.fn((entries, callback) =>
|
|
|
|
process.nextTick(() => callback(null)),
|
|
|
|
),
|
2020-03-25 04:35:58 +00:00
|
|
|
clear: jest.fn(callback => process.nextTick(() => callback(null))),
|
|
|
|
getAllKeys: jest.fn(callback =>
|
2019-05-31 10:12:46 +00:00
|
|
|
process.nextTick(() => callback(null, [])),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
DeviceInfo: {
|
|
|
|
getConstants() {
|
|
|
|
return {
|
|
|
|
Dimensions: {
|
|
|
|
window: {
|
|
|
|
fontScale: 2,
|
|
|
|
height: 1334,
|
|
|
|
scale: 2,
|
|
|
|
width: 750,
|
|
|
|
},
|
|
|
|
screen: {
|
|
|
|
fontScale: 2,
|
|
|
|
height: 1334,
|
|
|
|
scale: 2,
|
|
|
|
width: 750,
|
|
|
|
},
|
2019-05-29 23:30:40 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
};
|
|
|
|
},
|
2017-03-17 23:47:51 +00:00
|
|
|
},
|
2020-06-29 06:46:20 +00:00
|
|
|
DevSettings: {
|
|
|
|
addMenuItem: jest.fn(),
|
|
|
|
reload: jest.fn(),
|
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
ImageLoader: {
|
2022-09-12 21:11:28 +00:00
|
|
|
getSize: jest.fn(url => Promise.resolve([320, 240])),
|
2019-05-31 10:12:46 +00:00
|
|
|
prefetchImage: jest.fn(),
|
2017-06-29 07:58:52 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
ImageViewManager: {
|
|
|
|
getSize: jest.fn((uri, success) =>
|
|
|
|
process.nextTick(() => success(320, 240)),
|
|
|
|
),
|
|
|
|
prefetchImage: jest.fn(),
|
2019-05-30 21:23:39 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
KeyboardObserver: {
|
|
|
|
addListener: jest.fn(),
|
|
|
|
removeListeners: jest.fn(),
|
2019-05-22 10:18:24 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
Networking: {
|
|
|
|
sendRequest: jest.fn(),
|
|
|
|
abortRequest: jest.fn(),
|
|
|
|
addListener: jest.fn(),
|
|
|
|
removeListeners: jest.fn(),
|
|
|
|
},
|
|
|
|
PlatformConstants: {
|
|
|
|
getConstants() {
|
|
|
|
return {};
|
2017-05-15 22:44:52 +00:00
|
|
|
},
|
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
PushNotificationManager: {
|
|
|
|
presentLocalNotification: jest.fn(),
|
|
|
|
scheduleLocalNotification: jest.fn(),
|
|
|
|
cancelAllLocalNotifications: jest.fn(),
|
|
|
|
removeAllDeliveredNotifications: jest.fn(),
|
2020-03-25 04:35:58 +00:00
|
|
|
getDeliveredNotifications: jest.fn(callback =>
|
2019-05-31 10:12:46 +00:00
|
|
|
process.nextTick(() => []),
|
|
|
|
),
|
|
|
|
removeDeliveredNotifications: jest.fn(),
|
|
|
|
setApplicationIconBadgeNumber: jest.fn(),
|
2020-03-25 04:35:58 +00:00
|
|
|
getApplicationIconBadgeNumber: jest.fn(callback =>
|
2019-05-31 10:12:46 +00:00
|
|
|
process.nextTick(() => callback(0)),
|
|
|
|
),
|
|
|
|
cancelLocalNotifications: jest.fn(),
|
2020-03-25 04:35:58 +00:00
|
|
|
getScheduledLocalNotifications: jest.fn(callback =>
|
2019-05-31 10:12:46 +00:00
|
|
|
process.nextTick(() => callback()),
|
|
|
|
),
|
|
|
|
requestPermissions: jest.fn(() =>
|
|
|
|
Promise.resolve({alert: true, badge: true, sound: true}),
|
|
|
|
),
|
|
|
|
abandonPermissions: jest.fn(),
|
2020-03-25 04:35:58 +00:00
|
|
|
checkPermissions: jest.fn(callback =>
|
2019-05-31 10:12:46 +00:00
|
|
|
process.nextTick(() =>
|
|
|
|
callback({alert: true, badge: true, sound: true}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
getInitialNotification: jest.fn(() => Promise.resolve(null)),
|
|
|
|
addListener: jest.fn(),
|
|
|
|
removeListeners: jest.fn(),
|
|
|
|
},
|
|
|
|
SourceCode: {
|
|
|
|
getConstants() {
|
2019-04-24 13:47:16 +00:00
|
|
|
return {
|
2019-05-31 10:12:46 +00:00
|
|
|
scriptURL: null,
|
2019-04-24 13:47:16 +00:00
|
|
|
};
|
2019-05-31 10:12:46 +00:00
|
|
|
},
|
2017-03-23 04:22:44 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
StatusBarManager: {
|
|
|
|
setColor: jest.fn(),
|
|
|
|
setStyle: jest.fn(),
|
|
|
|
setHidden: jest.fn(),
|
|
|
|
setNetworkActivityIndicatorVisible: jest.fn(),
|
|
|
|
setBackgroundColor: jest.fn(),
|
|
|
|
setTranslucent: jest.fn(),
|
2019-07-24 22:21:04 +00:00
|
|
|
getConstants: () => ({
|
|
|
|
HEIGHT: 42,
|
|
|
|
}),
|
2016-10-17 15:40:11 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
Timing: {
|
|
|
|
createTimer: jest.fn(),
|
|
|
|
deleteTimer: jest.fn(),
|
2016-10-17 15:40:11 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
UIManager: {},
|
|
|
|
BlobModule: {
|
|
|
|
getConstants: () => ({BLOB_URI_SCHEME: 'content', BLOB_URI_HOST: null}),
|
|
|
|
addNetworkingHandler: jest.fn(),
|
|
|
|
enableBlobSupport: jest.fn(),
|
|
|
|
disableBlobSupport: jest.fn(),
|
|
|
|
createFromParts: jest.fn(),
|
|
|
|
sendBlob: jest.fn(),
|
|
|
|
release: jest.fn(),
|
2016-10-17 15:40:11 +00:00
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
WebSocketModule: {
|
|
|
|
connect: jest.fn(),
|
|
|
|
send: jest.fn(),
|
|
|
|
sendBinary: jest.fn(),
|
|
|
|
ping: jest.fn(),
|
|
|
|
close: jest.fn(),
|
|
|
|
addListener: jest.fn(),
|
|
|
|
removeListeners: jest.fn(),
|
|
|
|
},
|
2019-06-01 02:53:21 +00:00
|
|
|
I18nManager: {
|
|
|
|
allowRTL: jest.fn(),
|
|
|
|
forceRTL: jest.fn(),
|
|
|
|
swapLeftAndRightInRTL: jest.fn(),
|
|
|
|
getConstants: () => ({
|
|
|
|
isRTL: false,
|
|
|
|
doLeftAndRightSwapInRTL: true,
|
|
|
|
}),
|
|
|
|
},
|
2019-05-31 10:12:46 +00:00
|
|
|
}))
|
2020-11-19 18:53:49 +00:00
|
|
|
.mock('../Libraries/NativeComponent/NativeComponentRegistry', () => {
|
|
|
|
return {
|
|
|
|
get: jest.fn((name, viewConfigProvider) => {
|
2023-01-04 02:09:06 +00:00
|
|
|
return jest.requireActual('./mockNativeComponent').default(name);
|
2020-11-19 18:53:49 +00:00
|
|
|
}),
|
2020-11-21 02:50:49 +00:00
|
|
|
getWithFallback_DEPRECATED: jest.fn((name, viewConfigProvider) => {
|
2023-01-04 02:09:06 +00:00
|
|
|
return jest.requireActual('./mockNativeComponent').default(name);
|
2020-11-21 02:50:49 +00:00
|
|
|
}),
|
2020-11-19 18:53:49 +00:00
|
|
|
setRuntimeConfigProvider: jest.fn(),
|
2019-06-21 01:24:31 +00:00
|
|
|
};
|
2019-05-31 10:12:46 +00:00
|
|
|
})
|
2020-11-19 18:53:49 +00:00
|
|
|
.mock('../Libraries/ReactNative/requireNativeComponent', () => {
|
|
|
|
return jest.requireActual('./mockNativeComponent');
|
|
|
|
})
|
2019-05-31 10:12:46 +00:00
|
|
|
.mock(
|
|
|
|
'../Libraries/Utilities/verifyComponentAttributeEquivalence',
|
2021-11-03 05:10:46 +00:00
|
|
|
() => function () {},
|
2019-07-22 16:21:01 +00:00
|
|
|
)
|
2022-05-03 18:29:48 +00:00
|
|
|
.mock('../Libraries/Vibration/Vibration', () => ({
|
|
|
|
vibrate: jest.fn(),
|
|
|
|
cancel: jest.fn(),
|
|
|
|
}))
|
2019-07-22 16:21:01 +00:00
|
|
|
.mock('../Libraries/Components/View/ViewNativeComponent', () => {
|
|
|
|
const React = require('react');
|
|
|
|
const Component = class extends React.Component {
|
|
|
|
render() {
|
|
|
|
return React.createElement('View', this.props, this.props.children);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Component.displayName = 'View';
|
|
|
|
|
|
|
|
return {
|
|
|
|
__esModule: true,
|
|
|
|
default: Component,
|
|
|
|
};
|
|
|
|
});
|