mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-29 22:41:56 +08:00
Convert from React.createClass to ES6 classes
Reviewed By: cpojer Differential Revision: D3619143 fbshipit-source-id: e14e81468d467437ee3d79c34c34b7780a46ca1c
This commit is contained in:
committed by
Facebook Github Bot 8
parent
857d2b8eae
commit
a2fb703bbb
@@ -35,18 +35,12 @@ var {
|
||||
var UIExplorerBlock = require('UIExplorerBlock');
|
||||
var UIExplorerPage = require('UIExplorerPage');
|
||||
|
||||
var ToastExample = React.createClass({
|
||||
class ToastExample extends React.Component {
|
||||
static title = 'Toast Example';
|
||||
static description = 'Example that demonstrates the use of an Android Toast to provide feedback.';
|
||||
state = {};
|
||||
|
||||
statics: {
|
||||
title: 'Toast Example',
|
||||
description: 'Example that demonstrates the use of an Android Toast to provide feedback.',
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return {};
|
||||
},
|
||||
|
||||
render: function() {
|
||||
render() {
|
||||
return (
|
||||
<UIExplorerPage title="ToastAndroid">
|
||||
<UIExplorerBlock title="Simple toast">
|
||||
@@ -101,8 +95,8 @@ var ToastExample = React.createClass({
|
||||
</UIExplorerBlock>
|
||||
</UIExplorerPage>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
text: {
|
||||
|
||||
Reference in New Issue
Block a user