This approach works fine as long as the all the event data is available through the props. I have been working on an app where we need more data than what is available in the props.
We initially tried prop drilling and mapStateToProps to get all the required props from state, but it started to get messy, leading to adding code at random places and also unnecessary re-renders.
Right now, we are piggybacking on the already dispatched actions on every user action and running a saga that handles the gathering of all the data from the store.
Every User Interaction → Dispatch Action → Listen to action → Get Required data from store → fire the analytics event with the data.
Does this sound a good approach? I could use any advice.
Thank you.