File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 22 ComponentDidDisappearEvent ,
33 ComponentWillAppearEvent ,
44 ModalDismissedEvent ,
5+ ScreenPoppedEvent ,
56} from '../../src/interfaces/ComponentEvents' ;
67import { ComponentDidAppearEvent , NavigationButtonPressedEvent } from '../../src/index' ;
78import { BottomTabPressedEvent , CommandCompletedEvent } from '../../src/interfaces/Events' ;
@@ -14,6 +15,8 @@ export const events = {
1415 modalDismissed : [ ( _event : ModalDismissedEvent ) => { } ] ,
1516 bottomTabPressed : [ ( _event : BottomTabPressedEvent ) => { } ] ,
1617 commandCompleted : [ ( _event : CommandCompletedEvent ) => { } ] ,
18+ screenPopped : [ ( _event : ScreenPoppedEvent ) => { } ] ,
19+
1720 invokeComponentWillAppear : ( event : ComponentWillAppearEvent ) => {
1821 events . componentWillAppear &&
1922 events . componentWillAppear . forEach ( ( listener ) => {
@@ -56,4 +59,10 @@ export const events = {
5659 listener ( event ) ;
5760 } ) ;
5861 } ,
62+ invokeScreenPopped : ( event : ScreenPoppedEvent ) => {
63+ events . screenPopped &&
64+ events . screenPopped . forEach ( ( listener ) => {
65+ listener ( event ) ;
66+ } ) ;
67+ } ,
5968} ;
Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ export class NativeCommandsSender {
5555 LayoutStore . getLayoutById ( componentId ) . getStack ( ) . children
5656 ) as ComponentNode ;
5757 LayoutStore . pop ( componentId ) ;
58+ events . invokeScreenPopped ( {
59+ componentId,
60+ } ) ;
5861 resolve ( poppedChild . nodeId ) ;
5962 this . reportCommandCompletion ( CommandName . Pop , commandId ) ;
6063 } ) ;
Original file line number Diff line number Diff line change @@ -152,8 +152,9 @@ export class NativeEventsReceiver {
152152 }
153153
154154 public registerScreenPoppedListener (
155- _callback : ( event : ScreenPoppedEvent ) => void
155+ callback : ( event : ScreenPoppedEvent ) => void
156156 ) : EmitterSubscription {
157+ events . screenPopped . push ( callback ) ;
157158 return {
158159 remove : ( ) => { } ,
159160 } as EmitterSubscription ;
You can’t perform that action at this time.
0 commit comments