Skip to content

Instantly share code, notes, and snippets.

@agustito37
Last active October 27, 2020 16:15
import { useState } from 'react';
import { GREY_COLOR, BLACK_COLOR, WHITE_COLOR } from './globalStyles';
import { styles } from './styles';
const Component = () => {
const [isDisabled, setDisabled] = useState(true);
return (
<View style={styles.content}>
<Text style={[
styles.contentText,
{ color: isDisabled ? GREY_COLOR : BLACK_COLOR }
]}>
Hello World!
</Text>
<Button
style={[
styles.button,
{ backgroundColor: WHITE_COLOR, color: BLACK_COLOR }
]}
onCLick={() => setDisabled(current => !current)}
title="Toggle Disable"
/>
</View>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment