bikeshaving / crank

The Just JavaScript Framework

Home Page:https://crank.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Component render glitch when reusing elements defined outside of generator loop

GormanFletcher opened this issue · comments

Reproduction

If I define some elements outside of my render loop and render them conditionally, Crank does not display them when they're removed and displayed again.

Ah I see what’s going on. This is the result of some perhaps overzealous Inferno-inspired optimizations where we use the elements which users create as the actual internal nodes. This would be fine except that we are mutating the retained elements, so when you toggle back to the element which you yourself are retaining, the props have changed to match the other element.

Let me think a little bit about this and make sure it isn’t affecting performance, but expect a fix by tomorrow.

Hopefully fixed in 0.3.11

Looking good so far, thanks!