Permalink
Browse files

Fix tsx compilation errors

  • Loading branch information...
Justin-Credible committed Aug 14, 2016
1 parent c4b4580 commit 5bfcc12fb54998ed3e96dfa12e81b6e71883fb7d
Showing with 28 additions and 30 deletions.
  1. +14 −15 src/root.android.tsx
  2. +14 −15 src/root.ios.tsx
View
@@ -1,18 +1,15 @@
-/**
- * Sample React Native App
- * https://github.com/facebook/react-native
- * @flow
- */
-import React, { Component } from 'react';
+import * as React from "react";
+import { Component } from "react";
+
import {
- AppRegistry,
- StyleSheet,
- Text,
- View
-} from 'react-native';
+ AppRegistry,
+ StyleSheet,
+ Text,
+ View
+} from "react-native";
-class SampleApp1 extends Component {
+class SampleApp1 extends Component<any, any> {
render() {
return (
<View style={styles.container}>
@@ -37,17 +34,19 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
- },
+ } as __React.ViewStyle,
+
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
- },
+ } as __React.TextStyle,
+
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
- },
+ } as __React.TextStyle,
});
AppRegistry.registerComponent('SampleApp1', () => SampleApp1);
View
@@ -1,18 +1,15 @@
-/**
- * Sample React Native App
- * https://github.com/facebook/react-native
- * @flow
- */
-import React, { Component } from 'react';
+import * as React from "react";
+import { Component } from "react";
+
import {
- AppRegistry,
- StyleSheet,
- Text,
- View
-} from 'react-native';
+ AppRegistry,
+ StyleSheet,
+ Text,
+ View
+} from "react-native";
-class SampleApp1 extends Component {
+class SampleApp1 extends Component<any, any> {
render() {
return (
<View style={styles.container}>
@@ -37,17 +34,19 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
- },
+ } as __React.ViewStyle,
+
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
- },
+ } as __React.TextStyle,
+
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
- },
+ } as __React.TextStyle,
});
AppRegistry.registerComponent('SampleApp1', () => SampleApp1);

0 comments on commit 5bfcc12

Please sign in to comment.