Stateful Components dilema
Hi! I have a question about nested components, View Models, and Stateful Components.
I have an artboard called Ticket with several interactions. The last interaction is a ticket cut animation.
I then created the Ticket artboard as a component and nested it inside my main artboard. In the main artboard, I have another animation that scales the Ticket component up, and I want this animation to start right after the cut animation inside the Ticket component finishes.
I managed to make this work by using a View Model Trigger like cutFinished, exposing it as an Output, and enabling Stateful Component on the nested Ticket.
The problem is that when I enable Stateful Component, I lose the workflow I was using for the Ticket's data.
My Ticket View Model contains properties like:
artist name
artist photo
logo
other ticket information
In my Main View Model, I have multiple Ticket View Model instances, for example artist01, artist02, etc.
Normally, with the nested Ticket component, I can simply change the component's View Model instance from artist01 to artist02, and all of the Ticket data updates automatically.
But once I enable Stateful Component to expose the cutFinished output, that View Model instance selection seems to disappear.
So my question is:
What is the recommended way to keep using nested View Model instances to swap all the Ticket data, while also sending a Trigger or signal from the nested Ticket component back to the parent artboard when the cut animation finishes?
Ideally I would like to keep something like:
Ticket component → View Model instance = artist01 / artist02
while also having:
Ticket cut finishes → Main State Machine receives a trigger → Scale Up animation starts
Is there a way to do both without losing the View Model instance binding when using Stateful Components?
https://rive.app/marketplace/28815-54598-ticket-system/