Hex Core JS
    Preparing search index...

    Function filterJSXVisibleElements

    • Filters out items from the given array that will not be visibly rendered by React, leaving only items that are rendered visibly.

      Type Parameters

      • T

      Parameters

      • elements: T[]

        The array to filter.

      Returns Exclude<T, boolean | null | undefined>[]

      Does not check that elements are valid to render (e.g. checking for objects), but rather assumes all given elements can be rendered and just checks for those that are visible when rendered. Also does not check that elements will actually be visible to a user (e.g. empty HTML elements or elements with 0 opacity).