-
Notifications
You must be signed in to change notification settings - Fork 24.3k
/
react-native-implementation.js
388 lines (379 loc) · 10.6 KB
/
react-native-implementation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
const invariant = require('invariant');
const warnOnce = require('warnOnce');
// Export React, plus some native additions.
module.exports = {
// Components
get AccessibilityInfo() {
return require('AccessibilityInfo');
},
get ActivityIndicator() {
return require('ActivityIndicator');
},
get ART() {
return require('ReactNativeART');
},
get Button() {
return require('Button');
},
get CheckBox() {
warnOnce(
'checkBox-moved',
'CheckBox has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/checkbox' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-checkbox',
);
return require('CheckBox');
},
get DatePickerIOS() {
return require('DatePickerIOS');
},
get DrawerLayoutAndroid() {
return require('DrawerLayoutAndroid');
},
get FlatList() {
return require('FlatList');
},
get Image() {
return require('Image');
},
get ImageBackground() {
return require('ImageBackground');
},
get ImageEditor() {
warnOnce(
'image-editor-moved',
'Image Editor has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/image-editor' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-image-editor',
);
return require('ImageEditor');
},
get ImageStore() {
warnOnce(
'imagestore-deprecation',
'ImageStore is deprecated and will be removed in a future release. ' +
'To get a base64-encoded string from a local image use either of the following third-party libraries:' +
"* expo-file-system: `readAsStringAsync(filepath, 'base64')`" +
"* react-native-fs: `readFile(filepath, 'base64')`",
);
return require('ImageStore');
},
get InputAccessoryView() {
return require('InputAccessoryView');
},
get KeyboardAvoidingView() {
return require('KeyboardAvoidingView');
},
get MaskedViewIOS() {
warnOnce(
'maskedviewios-moved',
'MaskedViewIOS has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/masked-view' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-masked-view',
);
return require('MaskedViewIOS');
},
get Modal() {
return require('Modal');
},
get Picker() {
return require('Picker');
},
get PickerIOS() {
return require('PickerIOS');
},
get ProgressBarAndroid() {
return require('ProgressBarAndroid');
},
get ProgressViewIOS() {
return require('ProgressViewIOS');
},
get SafeAreaView() {
return require('SafeAreaView');
},
get ScrollView() {
return require('ScrollView');
},
get SectionList() {
return require('SectionList');
},
get SegmentedControlIOS() {
return require('SegmentedControlIOS');
},
get Slider() {
warnOnce(
'slider-moved',
'Slider has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/slider' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-slider',
);
return require('Slider');
},
get Switch() {
return require('Switch');
},
get RefreshControl() {
return require('RefreshControl');
},
get StatusBar() {
return require('StatusBar');
},
get Text() {
return require('Text');
},
get TextInput() {
return require('TextInput');
},
get ToolbarAndroid() {
return require('ToolbarAndroid');
},
get Touchable() {
return require('Touchable');
},
get TouchableHighlight() {
return require('TouchableHighlight');
},
get TouchableNativeFeedback() {
return require('TouchableNativeFeedback');
},
get TouchableOpacity() {
return require('TouchableOpacity');
},
get TouchableWithoutFeedback() {
return require('TouchableWithoutFeedback');
},
get View() {
return require('View');
},
get ViewPagerAndroid() {
warnOnce(
'viewpager-moved',
'ViewPagerAndroid has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/viewpager' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-viewpager',
);
return require('ViewPagerAndroid');
},
get VirtualizedList() {
return require('VirtualizedList');
},
get VirtualizedSectionList() {
return require('VirtualizedSectionList');
},
// APIs
get ActionSheetIOS() {
return require('ActionSheetIOS');
},
get Alert() {
return require('Alert');
},
get Animated() {
return require('Animated');
},
get AppRegistry() {
return require('AppRegistry');
},
get AppState() {
return require('AppState');
},
get AsyncStorage() {
warnOnce(
'async-storage-moved',
'Async Storage has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/async-storage' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-async-storage',
);
return require('AsyncStorage');
},
get BackHandler() {
return require('BackHandler');
},
get CameraRoll() {
warnOnce(
'cameraroll-moved',
'CameraRoll has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/cameraroll' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-cameraroll',
);
return require('CameraRoll');
},
get Clipboard() {
return require('Clipboard');
},
get DatePickerAndroid() {
return require('DatePickerAndroid');
},
get DeviceInfo() {
return require('DeviceInfo');
},
get Dimensions() {
return require('Dimensions');
},
get Easing() {
return require('Easing');
},
get findNodeHandle() {
return require('ReactNative').findNodeHandle;
},
get I18nManager() {
return require('I18nManager');
},
get ImagePickerIOS() {
return require('ImagePickerIOS');
},
get InteractionManager() {
return require('InteractionManager');
},
get Keyboard() {
return require('Keyboard');
},
get LayoutAnimation() {
return require('LayoutAnimation');
},
get Linking() {
return require('Linking');
},
get NativeEventEmitter() {
return require('NativeEventEmitter');
},
get PanResponder() {
return require('PanResponder');
},
get PermissionsAndroid() {
return require('PermissionsAndroid');
},
get PixelRatio() {
return require('PixelRatio');
},
get PushNotificationIOS() {
warnOnce(
'pushNotificationIOS-moved',
'PushNotificationIOS has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-push-notification-ios',
);
return require('PushNotificationIOS');
},
get Settings() {
return require('Settings');
},
get Share() {
return require('Share');
},
get StatusBarIOS() {
return require('StatusBarIOS');
},
get StyleSheet() {
return require('StyleSheet');
},
get Systrace() {
return require('Systrace');
},
get TimePickerAndroid() {
return require('TimePickerAndroid');
},
get ToastAndroid() {
return require('ToastAndroid');
},
get TurboModuleRegistry() {
return require('TurboModuleRegistry');
},
get TVEventHandler() {
return require('TVEventHandler');
},
get UIManager() {
return require('UIManager');
},
get unstable_batchedUpdates() {
return require('ReactNative').unstable_batchedUpdates;
},
get UTFSequence() {
return require('UTFSequence');
},
get Vibration() {
return require('Vibration');
},
get YellowBox() {
return require('YellowBox');
},
// Plugins
get DeviceEventEmitter() {
return require('RCTDeviceEventEmitter');
},
get NativeAppEventEmitter() {
return require('RCTNativeAppEventEmitter');
},
get NativeModules() {
return require('NativeModules');
},
get Platform() {
return require('Platform');
},
get processColor() {
return require('processColor');
},
get requireNativeComponent() {
return require('requireNativeComponent');
},
// Prop Types
get ColorPropType() {
return require('DeprecatedColorPropType');
},
get EdgeInsetsPropType() {
return require('DeprecatedEdgeInsetsPropType');
},
get PointPropType() {
return require('DeprecatedPointPropType');
},
get ViewPropTypes() {
return require('DeprecatedViewPropTypes');
},
};
if (__DEV__) {
// $FlowFixMe This is intentional: Flow will error when attempting to access ListView.
Object.defineProperty(module.exports, 'ListView', {
configurable: true,
get() {
invariant(
false,
'ListView has been removed from React Native. ' +
'See https://fb.me/nolistview for more information or use ' +
'`deprecated-react-native-listview`.',
);
},
});
// $FlowFixMe This is intentional: Flow will error when attempting to access SwipeableListView.
Object.defineProperty(module.exports, 'SwipeableListView', {
configurable: true,
get() {
invariant(
false,
'SwipeableListView has been removed from React Native. ' +
'See https://fb.me/nolistview for more information or use ' +
'`deprecated-react-native-swipeable-listview`.',
);
},
});
// $FlowFixMe This is intentional: Flow will error when attempting to access WebView.
Object.defineProperty(module.exports, 'WebView', {
configurable: true,
get() {
invariant(
false,
'WebView has been removed from React Native. ' +
"It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-webview',
);
},
});
}