Three options.
First: I just trying to run this script when it's loaded:
import getScrollbarWidth from 'get-scrollbar-width'
window.scrollbarWidth = getScrollbarWidth() // index.js:23 Uncaught TypeError: Cannot read property 'appendChild' of null
Second: I trying to run this script on jQuery.ready():
import getScrollbarWidth from 'get-scrollbar-width'
$(document).ready(() => {
window.scrollbarWidth = getScrollbarWidth() // -200 on macOS when scrollbars is hidden until scroll
})
Third: I'm trying to run this script on default exported function:
import getScrollbarWidth from 'get-scrollbar-width'
export default () => {
window.scrollbarWidth = getScrollbarWidth() // undefined
}
I'm not sure about last but first two must work.
Three options.
First: I just trying to run this script when it's loaded:
Second: I trying to run this script on
jQuery.ready():Third: I'm trying to run this script on default exported function:
I'm not sure about last but first two must work.