while working with react/JS is slowly getting easier, at times I'm still surprised why things don't work as I expect them to. Here, I'm trying to add a class to the '.edit-post-visual-editor__post-title-wrapper'-div and I'm using the below code in a JS file that is apparently correctly enqueued. When I inspect the page I see the element, it contains the post title. Yet somehow the console always tells me postTitleWrapper is null. What am I doing wrong here? Thanks for any help!
wp.domReady(function() {
const postTitleWrapper = document.querySelector('.edit-post-visual-editor__post-title-wrapper');
console.log(postTitleWrapper);
if (postTitleWrapper) {
postTitleWrapper.classList.add('something');
}
});