It looks like I never added setScreenIDForPopToRootAndReplaceEvent()
to StackScreenNavigatorItem
. To work around that, you will need to manually call popToRootAndReplace()
somewhere instead. You could do it in a couple of different ways:
1) Inside the screen class, instead of dispatching the event, call the popToRootAndReplace()
function directly on the parent StackScreenNavigator
. If your screen implements the IScreen
interface, the navigator can be accessed with the screen's owner
property.
2) Pass a function to the StackScreenNavigatorItem
instead of a class. In the function, you create an instance of your class and return it. However, before returning, you can call addEventListener()
on the screen with the event type that you want to listen for. In the listener, call _navigator.popToRootAndReplace()
.