()
| 8 | export function useScrollbarWidth(): void { |
| 9 | useEffect(() => { |
| 10 | const update = () => { |
| 11 | const width = window.innerWidth - document.documentElement.clientWidth; |
| 12 | document.documentElement.style.setProperty( |
| 13 | '--scrollbar-width', |
| 14 | `${width}px`, |
| 15 | ); |
| 16 | }; |
| 17 | |
| 18 | update(); |
| 19 | window.addEventListener('resize', update); |
no outgoing calls
no test coverage detected