I am learning TS and I am getting Object is possibly 'null' compailer error when I try to style some elemnt using js. I am confused how can I create interface for my below code. I am getting error here.
menuBar.style.marginLeft = '-300px',
settingDrop.style.display = "block"
What is the best way to solve this?
const subMenu = () => {
const menuBar = document.querySelector('.menu-bar')
const settingDrop = document.querySelector('.setting-drop')
menuBar.style.marginLeft = '-300px'
setTimeout(() => {
settingDrop.style.display = "block"
}, 100)
}