Closed noahtallen closed 6 years ago
I just found out the cause of the issue. Basically, I was adding the callbacks in componentDidMount
of a high-level component I had. However, this component was getting unmounted and re-mounted, which apparently registered the callback with the Native module twice. Making sure that the component only mounted once also ensured that the Radar callbacks were only configured once.
Great point
I have the
Radar.on('events', callback)
set up to listen for enter and exit events from the user. One thing I've noticed is that the callback always seems to get triggered twice, no matter the context. I have noticed this in my logs for the app on the app store, as well as watching it in debug mode. I'm not sure why. Thankfully our code handles the situation, but I'd like to make sure it only gets called once, just to be safe.