From f3ba979246e8e15b8c28f54bc0b3d06389e10f47 Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Wed, 18 Aug 2021 11:38:47 -0500 Subject: [PATCH] Attempt to fix `` re-rendering --- ts/components/conversation/ConversationHero.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts/components/conversation/ConversationHero.tsx b/ts/components/conversation/ConversationHero.tsx index 140499d79..2394b49b8 100644 --- a/ts/components/conversation/ConversationHero.tsx +++ b/ts/components/conversation/ConversationHero.tsx @@ -140,6 +140,9 @@ export const ConversationHero = ({ // this will cause a re-render loop. const previousHeight = previousHeightRef.current; if (previousHeight && height && previousHeight !== height) { + window.log.info( + `ConversationHero height changed from ${previousHeight} to ${height}` + ); onHeightChange?.(); } }, [height, onHeightChange]); @@ -176,7 +179,7 @@ export const ConversationHero = ({ bounds onResize={({ bounds }) => { assert(bounds, 'We should be measuring the bounds'); - setHeight(bounds.height); + setHeight(Math.ceil(bounds.height)); }} > {({ measureRef }) => (