Skip to content

Avoid using setTimeout in inkTabBarNode #135

@picodoth

Description

@picodoth

in #134, we're doing a quick fix by using setTimeout to calculate inkTabBarNode position after parent/root node mounted.

The source reason is that InkTabBarNode needs to do a offset calculation upon componentDidMount based on parent/root node ref. In the original mixin approach, componentDidMount is shared between multiple mixin and can be executed in sequence, but the new composite approach has nested component structure and following React lifecycle sequence:

parent render => children render => children mounted => parent mounted...

So strictly speaking, we have to delay children render in every possible parent of inkTabBarNode. As a quick fix, we did a awkward setTimeout in inkTabBarNode's componentDidMount method to achieve the same purpose.

In fact, the ideal fix was tried here, but apparently more work needs to do f019ea0#diff-ad3456d46a980c23853783634a1555a7R37

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