react-contextual icon indicating copy to clipboard operation
react-contextual copied to clipboard

Subscriber component causes re-mount of children on prop changes

Open afrankel-sfdo opened this issue 7 years ago • 5 comments

The subscriber HOC works fine, but the Component causes all children to re-mount on any prop changes.

contextual

See demo here: https://codesandbox.io/s/4jr86n2w77

Typing into Component text box loses focus on each keypress (due to re-mount), whereas the HOC works fine.

I suspect this is due to creating a new react element on each prop change here: https://github.com/drcmda/react-contextual/blob/master/src/subscribe.js#L73

afrankel-sfdo avatar Sep 13 '18 16:09 afrankel-sfdo

@drcmda #bump. Is this project still being maintained? Do you welcome PRs?

afrankel-sfdo avatar Oct 22 '18 14:10 afrankel-sfdo

@afrankel-sfdo, PR's would be most welcome.

smeijer avatar Oct 23 '18 20:10 smeijer

@smeijer I updated the code sandbox to better demonstrate the component remounting (HOC is fine) via console logs. Curious if you had any pointers for how to resolve before I dive in.

https://codesandbox.io/s/qkx5x5y5qj

mounting

afrankel-sfdo avatar Dec 28 '18 16:12 afrankel-sfdo

@smeijer bump. Any guidance before I try to resolve this?

afrankel-sfdo avatar Jan 14 '19 14:01 afrankel-sfdo

@smeijer ??

afrankel-sfdo avatar Feb 04 '19 16:02 afrankel-sfdo