Last active
September 9, 2023 14:20
-
-
Save andrew-levy/0d1ca25aeba5a0f2f2de6dfc131ac22b to your computer and use it in GitHub Desktop.
StyleSheet API
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
import { Text, StyleSheet } from 'react-native' | |
import { MyButton } from './components/MyButton'; | |
function App() { | |
return ( | |
<MyButton | |
style={styles.button} | |
onPress={() => console.log("Pressed")} | |
> | |
<Text style={styles.text}>Press Me!</Text> | |
</MyButton> | |
); | |
} | |
const styles = StyleSheet.create({ | |
button: { | |
backgroundColor: "blue", | |
paddingTop: 10, | |
borderWidth: 1, | |
}, | |
text: { | |
color: "white" | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment