Skip to content

Is there any way to access all of ReflexElements' sizes at once? #142

@growthwp

Description

@growthwp

Currently, the only way to get flex values are to listen to the onResizeStop but that only gives access to the data of the two ReflexElement being resized. I checked the docs, the relevant piece seems to be: https://gist.github.com/leefsmp/28ceb226d119d179d1e94466d2dd1a8b#file-re-flex-demo-storage-jsx

However, this misses a few cases:

  1. What do we do if we have more than 2 items? The resize event will only fire for two items but ignore the third (as it should). We're left to guess the flex of the 3rd, 4th,... item.

  2. Tied to 1 but data can only be retrieved when a resize happens. While you can provide initial flexes, let's assume from local storage, you'd need to have performed an onResizeStop event on all the ReflexElement components for you to be able to store ALL the values.

This can be mitigated by providing initial flexes on all the elements and then updating these that need updating on the onResizeStop event, but was wondering if this information was exposed somewhere.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions