Skip to content

Instantly share code, notes, and snippets.

@agustito37
Last active October 27, 2020 16:15
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 agustito37/d89db60561fbe5073e340f3b6c6c35b4 to your computer and use it in GitHub Desktop.
Save agustito37/d89db60561fbe5073e340f3b6c6c35b4 to your computer and use it in GitHub Desktop.
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