Created
January 8, 2017 07:05
-
-
Save JakeCoxon/24c090034ea63a0cf236fa903a30852f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HelpText = (props) => | |
<div {...props} style={css` | |
font-family: Helvetica; | |
padding: 10px; | |
background-color: white; | |
border: 1px inset #ccc; | |
`} />; | |
const state = observable({ value: 0 }); | |
autorun(() => | |
<HelpText> | |
Current state value is {state.value} | |
</HelpText> | |
); | |
<button onClick={() => state.value ++}> | |
Increase state value | |
</button>; | |
<button onClick={() => state.value = 0}> | |
Reset state value | |
</button> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment