re-resizable
re-resizable copied to clipboard
FlexBasis onComponentDidUpdate?
Overview of the problem
I'm using re-resizable 6.4.0
My browser is: Chrome
Description
Upon mounting of the Resizable component, it computes the flexBasis state from the computedStyle. However, it never updates its assumption of the flexBasis even if the style changes. The use-case here is building a resizable sidebar that collapses. If the sidebar begins shut, the flexBasis is 0 (assuming that the resizable component is using flex). Then when you try to "open" the sidebar, there's no way to tell Resizable to update its flexBasis state.
Steps to Reproduce
- Render a resizable component with flex-basis 0
- Re-render by applying new classname that gives it a different flex-basis
- Observe that the flex basis state does not change.
https://codesandbox.io/s/ll587k677z
Expected behavior
The component has its flex-basis updated
Actual behavior
The component does not have its flex-basis updated