Liking cljdoc? Tell your friends :D

Forcing Component re-creation?

React key with a stateful component

React key can be used to provide identity for components even outside of lists. If the key changes, the component is recreated triggering all the implemented stateful methods (did-unmount, did-mount etc.):

(defn comp []
  [:div
   ^{:key dynamic-id}
   [stateful-component]])

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close