Skip to content

Instantly share code, notes, and snippets.

@ryanlucas
Last active August 10, 2018 23:15
Show Gist options
  • Save ryanlucas/cff01982545e9536898b7460aa1107c2 to your computer and use it in GitHub Desktop.
Save ryanlucas/cff01982545e9536898b7460aa1107c2 to your computer and use it in GitHub Desktop.
On
On
tick -> Off
Off
tick -> On
const foo = document.createElement("script");
foo.type = "text/javascript";
foo.src = "https://unpkg.com/react-transition-group/dist/react-transition-group.min.js";
document.body.appendChild(foo);
let { CSSTransition } = ReactTransitionGroup;
function render(model){
const App = () => (
<CSSTransition timeout={2000} in classNames={{
appear: 'my-appear',
exit: 'my-done-exit'}}>
{status => <div>I'm {status}</div>}
</CSSTransition>
)
if (model.active_states[0].name === "Off") {
return <App />
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment