Not reviewed yet: this page may be outdated or inconsistent with the other guides. The API reference is generated from the current source.
How do I force 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]])