mirror of
https://github.com/react/react-native.git
synced 2026-10-08 20:38:50 +08:00
Summary: I removed var in ReactAndroid/src/androidTest. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ReactAndroid/src/androidTest] - remove var Pull Request resolved: https://github.com/facebook/react-native/pull/22137 Differential Revision: D12921228 Pulled By: TheSavior fbshipit-source-id: d3b7380b6047fc304265d0f47a53cb1170a6aea6
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
/**
|
|
* 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
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const BatchedBridge = require('BatchedBridge');
|
|
const DatePickerAndroid = require('DatePickerAndroid');
|
|
const React = require('React');
|
|
const RecordingModule = require('NativeModules')
|
|
.DatePickerDialogRecordingModule;
|
|
const View = require('View');
|
|
|
|
class DatePickerDialogTestApp extends React.Component {
|
|
render() {
|
|
return <View />;
|
|
}
|
|
}
|
|
|
|
const DatePickerDialogTestModule = {
|
|
DatePickerDialogTestApp: DatePickerDialogTestApp,
|
|
showDatePickerDialog: function(options) {
|
|
DatePickerAndroid.open(options).then(
|
|
({action, year, month, day}) => {
|
|
if (action === DatePickerAndroid.dateSetAction) {
|
|
RecordingModule.recordDate(year, month, day);
|
|
} else if (action === DatePickerAndroid.dismissedAction) {
|
|
RecordingModule.recordDismissed();
|
|
}
|
|
},
|
|
({code, message}) => RecordingModule.recordError(),
|
|
);
|
|
},
|
|
};
|
|
|
|
BatchedBridge.registerCallableModule(
|
|
'DatePickerDialogTestModule',
|
|
DatePickerDialogTestModule,
|
|
);
|
|
|
|
module.exports = DatePickerDialogTestModule;
|