Convert from React.createClass to ES6 classes

Reviewed By: cpojer

Differential Revision: D3619143

fbshipit-source-id: e14e81468d467437ee3d79c34c34b7780a46ca1c
This commit is contained in:
Ben Alpert
2016-07-26 01:13:31 -07:00
committed by Facebook Github Bot 8
parent 857d2b8eae
commit a2fb703bbb
133 changed files with 2124 additions and 2191 deletions
@@ -32,27 +32,19 @@ var {
var UIExplorerBlock = require('./UIExplorerBlock');
var UIExplorerPage = require('./UIExplorerPage');
var TimePickerAndroidExample = React.createClass({
class TimePickerAndroidExample extends React.Component {
static title = 'TimePickerAndroid';
static description = 'Standard Android time picker dialog';
statics: {
title: 'TimePickerAndroid',
description: 'Standard Android time picker dialog',
},
state = {
isoFormatText: 'pick a time (24-hour format)',
presetHour: 4,
presetMinute: 4,
presetText: 'pick a time, default: 4:04AM',
simpleText: 'pick a time',
};
getInitialState() {
// *Text, *Hour and *Minute are set by successCallback -- this updates the text with the time
// picked by the user and makes it so the next time they open it the hour and minute they picked
// before is displayed.
return {
isoFormatText: 'pick a time (24-hour format)',
presetHour: 4,
presetMinute: 4,
presetText: 'pick a time, default: 4:04AM',
simpleText: 'pick a time',
};
},
async showPicker(stateKey, options) {
showPicker = async (stateKey, options) => {
try {
const {action, minute, hour} = await TimePickerAndroid.open(options);
var newState = {};
@@ -67,7 +59,7 @@ var TimePickerAndroidExample = React.createClass({
} catch ({code, message}) {
console.warn(`Error in example '${stateKey}': `, message);
}
},
};
render() {
return (
@@ -100,8 +92,8 @@ var TimePickerAndroidExample = React.createClass({
</UIExplorerBlock>
</UIExplorerPage>
);
},
});
}
}
/**
* Returns e.g. '3:05'.