JQuery toggleClass not working in React.js when i try to click on the element

If i try to toggle the class(active) nothing hapens just flashing in the dev tools.
Here is the picture.
And here is my code:

let usercontainer = document.querySelector(".user-container")
let user = document.querySelector(".user")
    
$(user).on('click', function() {
    $(usercontainer).toggleClass(".active")
})