Fix compact composer flash on tab switch

This commit is contained in:
Mohamed Boudra
2026-06-03 19:32:49 +07:00
parent 76ae8c19b0
commit 3634f5e2d8
2 changed files with 29 additions and 1 deletions
@@ -31,7 +31,11 @@ export function useContainerWidthBelow(
return {
onLayout: useCallback(
(e: LayoutChangeEvent) => {
const nextIsBelow = e.nativeEvent.layout.width < threshold;
const width = e.nativeEvent.layout.width;
if (width <= 0) {
return;
}
const nextIsBelow = width < threshold;
setIsBelow((currentIsBelow) =>
currentIsBelow === nextIsBelow ? currentIsBelow : nextIsBelow,
);