I recently developed a custom modal in React. When the Open button is clicked, showModal is set to true and the modal display changes to block. Conversely, clicking the Close button sets the display to none.
However, I noticed a bug where upon refreshing the page, the content of the modal briefly appears on screen for a few milliseconds.
This functionality is crucial for my application.
If you want to see it in action, check out this video link: https://youtu.be/A6CUmSzwobY
You can also view the code on CodePen by following this link:
https://codepen.io/alligatorio/pen/aYzMKL?editors=0100
Any help in identifying and resolving this issue would be greatly appreciated.