Skip to content

Instantly share code, notes, and snippets.

@Deraen
Last active July 27, 2016 21:15
Show Gist options
  • Save Deraen/ae8e142ea3d06e31eacb998dcef9d8cb to your computer and use it in GitHub Desktop.
Save Deraen/ae8e142ea3d06e31eacb998dcef9d8cb to your computer and use it in GitHub Desktop.
(defn animated-component []
(let [fade-anim (ui/animated-value. 0)]
(r/create-class
{:component-did-mount
(fn [this]
(-> ui/animated
(.timing fade-anim #js {:toValue 1
:duration 3000})
(.start)))
:reagent-render
(fn []
[ui/animated-view
{:style {:background-color "blue"
:width 20
:height 20
:opacity fade-anim}}])}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment