reagent/docs/FAQ/ComponentNotRerendering.md

782 B

Question

My component is not rerendering, what should I do?

Answer

This could happen for a few reasons. Try the following:

  1. Make sure you are using a reagent.core/atom (i.e., ratom) instead of a normal atom.
  2. Make sure to deref your ratom (e.g, @app-state) inside of your component.
  3. Make sure your ratom will survive a rerender. Either declare it as a global var, or use a form-2 component. Read this if you want to understand why.
  4. Make sure to deref your ratom outside of a seq or wrap that seq in a doall. See this related issue.

Up: FAQ Index