I have component which render’s three component using map and I have implemented expand/collapse feature on each child component.
Inside the component I am using refCallback to get the full height of component and if it greater than a certain threshold I reduce the height and show CTA. For unknown reason this works fine when navigating using react routes inside the app, but I open the page directly via SSR the last of three components height returned by ref.current.clientHeight is less than the actual DOM side.
Please suggest what is possibly wrong here
refCallback :
<code>const cb = (node: Div) => {
if (node !=== null) {
const height = parseInt(getComputedStyle(node).height);
//threshold logic to set heigt of a div
}
}
</code>
<code>const cb = (node: Div) => {
if (node !=== null) {
const height = parseInt(getComputedStyle(node).height);
//threshold logic to set heigt of a div
}
}
</code>
const cb = (node: Div) => {
if (node !=== null) {
const height = parseInt(getComputedStyle(node).height);
//threshold logic to set heigt of a div
}
}