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