Skip to content

Instantly share code, notes, and snippets.

@ozcanzaferayan
Last active May 19, 2020 21:26
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 ozcanzaferayan/8d75d833505c9f83beb65d6f5e3cf96b to your computer and use it in GitHub Desktop.
Save ozcanzaferayan/8d75d833505c9f83beb65d6f5e3cf96b to your computer and use it in GitHub Desktop.
function FontButton() {
const [fontSize, setFontSize] = useRecoilState(fontSizeState);
const fontSizeLabel = useRecoilValue(fontSizeLabelState);
return (
<>
<div>Current font size: ${fontSizeLabel}</div>
<button onClick={() => setFontSize(fontSize + 1)} style={{fontSize}}>
Click to Enlarge
</button>
</>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment