Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Last active August 30, 2016 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lopezjurip/832bf44495f73502c6508d379c5a26b7 to your computer and use it in GitHub Desktop.
Save lopezjurip/832bf44495f73502c6508d379c5a26b7 to your computer and use it in GitHub Desktop.
declare module "react-native-button" {
const value: any;
export default value;
}
// 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