Eui: [EuiResizableContainer] Allow for dynamic prop changes

Created on 19 Feb 2021  路  1Comment  路  Source: elastic/eui

Mainly, what I'm trying to accomplish is changing the direction based on window size. But when that window size changes to where the prop would change, the component breaks and errors out:

https://user-images.githubusercontent.com/549577/108527994-ee1ace00-72a0-11eb-9c0b-c12e7ef8af1b.mp4

My (simplified) setup:

const isMobile = useIsWithinBreakpoints(['xs', 's']);

return (
<EuiResizableContainer direction={isMobile ? 'vertical' : 'horizontal'}>
  ...
</EuiResizableContainer>
);

I tried recreating this in a codesandbox, but I'm getting an error about the exported hook useIsWithinBreakpoints not existing.

Related: https://github.com/elastic/kibana/pull/86934#issuecomment-782085340

engineer

Most helpful comment

This has come up before in #4464, and #4489 is somewhat related.
I can take a look

>All comments

This has come up before in #4464, and #4489 is somewhat related.
I can take a look

Was this page helpful?
0 / 5 - 0 ratings