Last active
August 30, 2016 02:51
-
-
Save lopezjurip/832bf44495f73502c6508d379c5a26b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module "react-native-button" { | |
const value: any; | |
export default value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/index.ts | |
import React, { Component } from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View | |
} from 'react-native'; | |
import Button from "react-native-button"; | |
interface Props { | |
} | |
interface State { | |
} | |
export default class App extends Component<Props, State> { | |
onPress = () => { | |
alert("It's working fine"); | |
} | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.text}> | |
Welcome to React Native! | |
</Text> | |
<Button onPress={this.onPress}> | |
Hi there! | |
</Button> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: '#F5FCFF', | |
} as React.ViewStyle, | |
text: { | |
fontSize: 20, | |
textAlign: 'center', | |
margin: 10, | |
} as React.TextStyle, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment