I have the following code snippet:
const userLogin = someVar.current; // this can be null at some point
const userField = userLogin.querySelector("#some-id");
I am using Jetbrains Webstorm and it is complaining because userLogin can be null which is true but ... if I do:
userLogin?.querySelector("#some-id");
then it complains because querySelector does not exists on type never I have tried putting everything in a condition and check if userLogin is not null but the result is the same querySelector does not exists on never can I get some ideas for how to get this right?