Skip to content

Instantly share code, notes, and snippets.

@JakeCoxon
Created January 8, 2017 07:05
Show Gist options
  • Save JakeCoxon/24c090034ea63a0cf236fa903a30852f to your computer and use it in GitHub Desktop.
Save JakeCoxon/24c090034ea63a0cf236fa903a30852f to your computer and use it in GitHub Desktop.
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