Skip to content

How to avoid crash on component change? #156

@therealgilles

Description

@therealgilles

This is more of a question than an issue but I was not sure where else to post.

I enabled text balancing on a React component whose content can change based on its props. Due to how the props are computed, the content of the component changes when it is mounted. Due to JS event scheduling, the component content changes as the balance-text library is trying to balance the text, leading to window.getComputedStyle() to error out as the element is gone, and removeChild() to also error out.

Any suggestions on how to work around this problem? (which I admit is not really an issue with the library)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions