Forum Academy Marketplace Showcase Pricing Features

Tracking currently selected contact record - set state or pass data?

For the sake of context, my app is like a CRM. A contact has a bunch of associated records (tasks, meetings etc) . I was using one page with tabs but that become irritating to work with very quickly so I moved to separate pages (contact_tasks, contact_meetings etc…)

Right now I pass the ‘current page contact’ as users navigate through but was wondering if it’s a better idea to store the currently selected contact inside a custom state instead.

The main problem is so I can have each page (contact_tasks, contact_meetings etc) use the proper date type at the page level so I’m not having to grab data a bunch of times on each page.

I would normally store the ‘current contact’ as a session variable “in the old days” so I think putting that in a custom state makes more sense, but just wanted to see what others were doing.