Hi Marian

It's a good question, but not one that I have a direct answer to.

I wonder if you avoided calling reagent/render on Figwheel reload, and
instead triggered a re-render inside the component (say by incrementing a
Ratom which would cause the child to re-render) if that would avoid
destroying the components and recreating them. However I'm not sure how
that would interact with using stale code...

On Sat, Dec 2, 2017 at 9:02 AM marian-c <marianco...@gmail.com> wrote:

> Every time Figwheel reloads the application the whole DOM is re-rendered /
> re-mounted.
>
> This is causing the *chrome dev-tools's elements panel to reset*
> (collapses the whole tree, de-selects the selected element for inspection)
>
> This (whole tree remount) has been brought up in the past but only in the
> context of loosing local component state.
>
> Is there anyway of preventing Reagent make React re-render the full tree
> and only update the components that changed?
>
> Digging a bit in React's source code, the ReactDOM.render docs state:
>
>    * If the React component was previously rendered into `container`, this
> will
>    * perform an update on it and only mutate the DOM as necessary to
> reflect the
>    * latest React component.
>
> While going a bit deep in React's internals, I did mange to figure out
> that if the root of the reagent application is a :div it will not opt to
> immediately remove/add
> the DOM tree but later on it still decides to.
>
> I appreciate any help; Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Reagent-Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reagent-project+unsubscr...@googlegroups.com.
> To post to this group, send email to reagent-project@googlegroups.com.
> Visit this group at https://groups.google.com/group/reagent-project.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Reagent-Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reagent-project+unsubscr...@googlegroups.com.
To post to this group, send email to reagent-project@googlegroups.com.
Visit this group at https://groups.google.com/group/reagent-project.
For more options, visit https://groups.google.com/d/optout.

Reply via email to