Skip to content

Subscriber component causes re-mount of children on prop changes #34

@afrankel-sfdo

Description

@afrankel-sfdo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions