()
| 324 | useClientLayoutEffect(() => { |
| 325 | const element = ref.current; |
| 326 | const publish = () => { |
| 327 | // Out of the layout (see `gone`) it measures 0; the last height holds. |
| 328 | if (element && !element.getClientRects().length) { |
| 329 | return; |
| 330 | } |
| 331 | document.documentElement.style.setProperty( |
| 332 | '--shell-top', |
| 333 | `${element?.offsetHeight ?? 0}px`, |
| 334 | ); |
| 335 | setShellEdge(element ? element.offsetTop + element.offsetHeight : 0); |
| 336 | }; |
| 337 | publish(); |
| 338 | const observer = element ? new ResizeObserver(publish) : undefined; |
| 339 | if (element) { |
no test coverage detected