Skip to content

Instantly share code, notes, and snippets.

@agustito37
Last active November 2, 2020 16:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save agustito37/2f49201ea6f7a7cfce3318181f6e00c4 to your computer and use it in GitHub Desktop.
import { useState } from 'react';
import useStyles from './styles';
const Component = () => {
const [isDisabled, setDisabled] = useState(false);
const s = useStyles([isDisabled]);
return (
<View style={s`.content`}>
<Text style={s`.contentText &disabled`}>Hello World!</Text>
<Button
style={s`.button bg:color:$white color:$black`}
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