abdalla / react-hotjar

Small component to implement Hotjar into your react application
MIT License
165 stars 32 forks source link

Add helper function to check if Hotjar has been intialized #37

Closed jstarmx closed 2 years ago

jstarmx commented 2 years ago

If you only initialize Hotjar conditionally based certain criteria (e.g. only on a production environment), you need to check it's been initialized before using the module elsewhere in the codebase, otherwise it will throw an error. This adds a helper function to make that check.