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:00:02 -07:00
committed by Facebook Github Bot 8
parent 857d2b8eae
commit a2fb703bbb
133 changed files with 2124 additions and 2191 deletions

View File

@@ -36,40 +36,35 @@ var UIExplorerPage = require('./UIExplorerPage');
var importantForAccessibilityValues = ['auto', 'yes', 'no', 'no-hide-descendants'];
var AccessibilityAndroidExample = React.createClass({
class AccessibilityAndroidExample extends React.Component {
static title = 'Accessibility';
static description = 'Examples of using Accessibility API.';
statics: {
title: 'Accessibility',
description: 'Examples of using Accessibility API.',
},
state = {
count: 0,
backgroundImportantForAcc: 0,
forgroundImportantForAcc: 0,
};
getInitialState: function() {
return {
count: 0,
backgroundImportantForAcc: 0,
forgroundImportantForAcc: 0,
};
},
_addOne: function() {
_addOne = () => {
this.setState({
count: ++this.state.count,
});
},
};
_changeBackgroundImportantForAcc: function() {
_changeBackgroundImportantForAcc = () => {
this.setState({
backgroundImportantForAcc: (this.state.backgroundImportantForAcc + 1) % 4,
});
},
};
_changeForgroundImportantForAcc: function() {
_changeForgroundImportantForAcc = () => {
this.setState({
forgroundImportantForAcc: (this.state.forgroundImportantForAcc + 1) % 4,
});
},
};
render: function() {
render() {
return (
<UIExplorerPage title={'Accessibility'}>
@@ -202,8 +197,8 @@ var AccessibilityAndroidExample = React.createClass({
</UIExplorerPage>
);
},
});
}
}
var styles = StyleSheet.create({
embedded: {