Created
March 11, 2017 17:42
-
-
Save manojsinghnegiwd/0afc3b182983c2bd4b627fdd8355330e to your computer and use it in GitHub Desktop.
Creating A React Native Android Button Component.
This file contains 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
import React, { Component } from 'react'; |
This file contains 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
import { | |
View, | |
TouchableNativeFeedback | |
} from 'react-native'; |
This file contains 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
render () { | |
return ( | |
<View> | |
<Button isRipple onPress={() => alert(‘This works great’) } style={{ width: 100, height: 50, justifyContent: "center",alignItems: "center"}} rippleColor="red"> | |
<Text> Button </Text> | |
</Button> | |
</View> | |
) | |
} |
This file contains 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
let {onPress, isRipple, rippleColor, children, style} = this.props; |
This file contains 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
export default class Button extends Component { | |
render () { | |
return ( | |
<View> | |
</View> | |
) | |
} | |
} |
This file contains 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
touch Button.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment