add ComponentNotRerendering FAQ;

This commit is contained in:
Matthew Jaoudi 2018-02-26 17:23:16 -08:00
parent e3e7324548
commit d85f10130c
2 changed files with 22 additions and 5 deletions

View File

@ -0,0 +1,16 @@
### 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](https://github.com/reagent-project/reagent-cookbook/tree/master/basics/component-level-state) 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](https://github.com/reagent-project/reagent/issues/18).
***
Up: [FAQ Index](README.md)      

View File

@ -18,11 +18,12 @@ Also:
## Frequently Asked Questions ## Frequently Asked Questions
1. [How do I use React's "refs"](FAQ/UsingRefs.md) 1. [How do I use React's "refs"](FAQ/UsingRefs.md)
1. [How can I use an entity like "nbsp"?](FAQ/UsingAnEntity.md) 2. [How can I use an entity like "nbsp"?](FAQ/UsingAnEntity.md)
2. [Why is my attribute (like autoFocus) missing?](FAQ/MyAttributesAreMissing.md) 3. [Why is my attribute (like autoFocus) missing?](FAQ/MyAttributesAreMissing.md)
3. [How can I use React's dangerouslySetInnerHTML?](FAQ/dangerouslySetInnerHTML.md) 4. [How can I use React's dangerouslySetInnerHTML?](FAQ/dangerouslySetInnerHTML.md)
3. [How do I force Component re-creation?](https://groups.google.com/forum/#!topic/reagent-project/tNY4gzk7TUY) (external link) 5. [How do I force Component re-creation?](https://groups.google.com/forum/#!topic/reagent-project/tNY4gzk7TUY) (external link)
4. [How do I access "props" in lifecycle methods?](http://nils-blum-oeste.net/clojurescripts-reagent-using-props-in-lifecycle-hooks/) (external link) 6. [How do I access "props" in lifecycle methods?](http://nils-blum-oeste.net/clojurescripts-reagent-using-props-in-lifecycle-hooks/) (external link)
7. [My component is not rerendering, what should I do?](FAQ/ComponentNotRerendering.md)
## Commercial Videos Series ## Commercial Videos Series