Currently enableLinkTracking is set to true by default (per the doc of this library), but we still have issues like #25 since this is normally an issue with SPAs. Anytime React components re-render, then the event listener is lost and those links aren't tracked anymore.
This results in inconsistent behavior (links are tracked on initial page load, but they're not tracked if a user navigates the site and causes component re-renders)
So we either have to:
Call enableLinkTracking again for each render (basically every component that has a link), which gets tedious and has inconsistent behavior if missed.. or
Call trackLink explicitly using our own onClick handler, which is also tedious
I suggest we set it to false by default and let the client decide how to proceed, or somehow enable this to be set again even on re-renders
Currently
enableLinkTracking
is set to true by default (per the doc of this library), but we still have issues like #25 since this is normally an issue with SPAs. Anytime React components re-render, then the event listener is lost and those links aren't tracked anymore.This results in inconsistent behavior (links are tracked on initial page load, but they're not tracked if a user navigates the site and causes component re-renders)
So we either have to:
enableLinkTracking
again for each render (basically every component that has a link), which gets tedious and has inconsistent behavior if missed.. ortrackLink
explicitly using our ownonClick
handler, which is also tediousI suggest we set it to false by default and let the client decide how to proceed, or somehow enable this to be set again even on re-renders