solid-spring icon indicating copy to clipboard operation
solid-spring copied to clipboard

[Bug] Any children on an animated element gets mounted twice and the second ref is unusable

Open vanillacode314 opened this issue 1 year ago • 5 comments

Repro

https://codesandbox.io/s/solidspringdoublemountrepro-7jqzuv?file=%2Fsrc%2Fmain.tsx

Workaround

function() {
  let myRef
  return (
    <animated.div style={{'backgroud-color':'red',...expand()}}>
      <div ref={(el)=> {
          if (myRef) return
          myRef = el
        }}
      >
        I get mounted twice and the second ref is unusable
      </div>
    </animated.div>
  )
}

vanillacode314 avatar Oct 12 '22 19:10 vanillacode314

Interesting, Anyone interested for this?

Aslemammad avatar Oct 13 '22 08:10 Aslemammad

what do you mean by interested?

vanillacode314 avatar Oct 13 '22 08:10 vanillacode314

I mean interested in working/solving on this issue.

Aslemammad avatar Oct 13 '22 08:10 Aslemammad

I might if you can give me some direction as where should I look in the codebase

vanillacode314 avatar Oct 13 '22 08:10 vanillacode314

The best thing to do is to put debugger in your code or the solid-spring source code! That's the best way to debug honestly!

Aslemammad avatar Oct 13 '22 09:10 Aslemammad