Attempt to fix <ConversationHero>
re-rendering
This commit is contained in:
parent
7a8363c7c8
commit
f3ba979246
1 changed files with 4 additions and 1 deletions
|
@ -140,6 +140,9 @@ export const ConversationHero = ({
|
||||||
// this will cause a re-render loop.
|
// this will cause a re-render loop.
|
||||||
const previousHeight = previousHeightRef.current;
|
const previousHeight = previousHeightRef.current;
|
||||||
if (previousHeight && height && previousHeight !== height) {
|
if (previousHeight && height && previousHeight !== height) {
|
||||||
|
window.log.info(
|
||||||
|
`ConversationHero height changed from ${previousHeight} to ${height}`
|
||||||
|
);
|
||||||
onHeightChange?.();
|
onHeightChange?.();
|
||||||
}
|
}
|
||||||
}, [height, onHeightChange]);
|
}, [height, onHeightChange]);
|
||||||
|
@ -176,7 +179,7 @@ export const ConversationHero = ({
|
||||||
bounds
|
bounds
|
||||||
onResize={({ bounds }) => {
|
onResize={({ bounds }) => {
|
||||||
assert(bounds, 'We should be measuring the bounds');
|
assert(bounds, 'We should be measuring the bounds');
|
||||||
setHeight(bounds.height);
|
setHeight(Math.ceil(bounds.height));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{({ measureRef }) => (
|
{({ measureRef }) => (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue