Skip to content

responsive component inside of responsive component doesn't work #86

@hoschi

Description

@hoschi

I have the case that I built a component which needs to be resizable on its own, but must use another component which is also resizable:

let InnerResizable = componentQueries(queryInner)(InnerDumb)

let OuterResizableDumb = ({fromQuery, otherProp}) => {
  return <div>
            {fromQuery &&
            <span>only visible when size fits</span>}
            <InnerResizable>see my prop {otherProp}</InnerResizable>
        </div>
}

let OuterResizable = componentQueries(queryOuter)(OuterResizableDumb)

On first render both components call their queries and resize right. On browser window resize the only component which updates (and calls their query) is the inner one. The outer one doesn't call their query and because of that it never changes its query result and isn't responsive.

By the time I developed the outer component, the inner one was not resizable. That way I know the outer version works fine without the inner one. As soon as I made the inner one also responsive the outer one stopped working.

For react-sizeme and react-component-queries I'm on the latest version. element-resize-detector is version 1.1.12 as dependency from another third party component. React is version 15.4.2.

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