The only React hook you will need for boolean states

Toggling Modal visibility; hiding, and showing messages, there are many scenarios where you’ll find yourself writing the same code. But there's a solution: useBooleanState

The useBooleanState hook

Going straight to the code, this is how it looks:

How to use it?