Ref pointing to the wrong element
I have a component that uses a
ref
:
Let's say the component is called Foo
. I have a parent component rendering Foo
twice. The problem is that both refs bodyElement
are pointing to the ref
in the last Foo
component.
Inside Foo
I log the ref
s:
and I notice that the logs are pointing to the same element, the last bodyElement (in the last Foo).
I could not reproduce the problem in the playground.3 Replies