Quasy – modal component does not hide itself

The problem is that you’re using setIsOpen() incorrectly.

Your code initialises isOpen as false, and your code implies that it can be either true or false, but that’s not what you’re setting it as. The setIsOpen() function updates isOpen to the value you pass to it, and you’re passing an object with an isOpen property, not a boolean value.

When you call setIsOpen({ isOpen: false }), you’re not setting isOpen to false, you’re setting it to { isOpen: false }. You need to just pass true or false:

<Button isDefault onClick={ () => setIsOpen(false) }>

Note that this is React functionality, not anything to do with WordPress, so you should review the documentation for useState().