·
I am learning REACT, and here I crafted a Modal popping on button push.
You then close it either by a close button in the modal or by clicking anywhere in the background overlay.
I used the portal feature of REACT, to display in a specific place from anywhere in the code my modal.
I used also the useState to synchronize the on/off on the modal.
And the architecture is the main component embeds a custom component that contains a button to pop the modal.
Here is the code, git clone, build and run it.
#react #modal #programming