Perhaps you have inadvertently overriden `alert` elsewhere in your code, due to something like `alert = "Hello World"`? Some pop-up blockers do this intentionally as a method of disabling alerts. Regardless, the code you've provided *does not recreate the issue*, therefore we can only blindly guess.
– Tyler RoperJan 06 '19 at 04:59
Possible duplicate of [Error on using alert in Javascript (Property 'alert' of object is not a function)](https://stackoverflow.com/questions/11334581/error-on-using-alert-in-javascript-property-alert-of-object-is-not-a-function)
– Mohammad UsmanJan 06 '19 at 05:45
I think @Tyler Roper is right, I had a similar error, after reading his comment, it turns out I am passing alert as props from another component, this was as a result of a bad naming convention though. but his comment saved me
– Solomon SundayFeb 04 '22 at 23:08