Update templates to ES2015

Summary:
I don't know the reasons, why the templates are written with the `react.createClass`method. Today I see lot's of examples using the **ES6 way**. In my own projects I'm using this way, too.

I removed `use strict`, since *Module code is always strict mode code*, according to the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-strict-mode-code).

Maybe we should **discuss** the usage of ES6 in the templates.
Closes https://github.com/facebook/react-native/pull/4891

Reviewed By: svcscm

Differential Revision: D2789493

Pulled By: androidtrunkagent

fb-gh-sync-id: 90e70f787017c61dc64cbc9f0beb02331fa749ec
This commit is contained in:
Patrick Puritscher 2015-12-25 02:16:36 -08:00 committed by facebook-github-bot-6
parent a47fcd44f9
commit bde2f30474
2 changed files with 16 additions and 18 deletions

View File

@ -3,17 +3,16 @@
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
} = React;
View
} from 'react-native';
var <%= name %> = React.createClass({
render: function() {
class <%= name %> extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
@ -28,9 +27,9 @@ var <%= name %> = React.createClass({
</View>
);
}
});
}
var styles = StyleSheet.create({
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',

View File

@ -3,17 +3,16 @@
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
} = React;
View
} from 'react-native';
var <%= name %> = React.createClass({
render: function() {
class <%= name %> extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
@ -29,9 +28,9 @@ var <%= name %> = React.createClass({
</View>
);
}
});
}
var styles = StyleSheet.create({
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',