Skip to content

Instantly share code, notes, and snippets.

@andrew-levy
Last active September 9, 2023 14:20
Show Gist options
  • Save andrew-levy/0d1ca25aeba5a0f2f2de6dfc131ac22b to your computer and use it in GitHub Desktop.
Save andrew-levy/0d1ca25aeba5a0f2f2de6dfc131ac22b to your computer and use it in GitHub Desktop.
StyleSheet API
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