mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-06 09:10:30 +00:00
Merge pull request #26325 from jasonmerino/react-native-navigation-navigatorevent
react-native-navigation NavigatorEvent adding more id types and type prop
This commit is contained in:
+3
-1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for react-native-navigation 1.1
|
||||
// Project: https://github.com/wix/react-native-navigation
|
||||
// Definitions by: Egor Shulga <https://github.com/egorshulga>
|
||||
// Jason Merino <https://github.com/jasonmerino>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -119,7 +120,8 @@ export interface LightBox {
|
||||
}
|
||||
|
||||
export interface NavigatorEvent {
|
||||
id: 'willAppear' | 'didAppear' | 'willDisappear' | 'didDisappear' | 'willCommitPreview' | 'backPress';
|
||||
id: 'willAppear' | 'didAppear' | 'willDisappear' | 'didDisappear' | 'willCommitPreview' | 'backPress' | 'bottomTabSelected' | 'bottomTabReselected' | string;
|
||||
type: 'NavBarButtonPress' | 'DeepLink';
|
||||
}
|
||||
|
||||
export class Navigator {
|
||||
|
||||
@@ -20,6 +20,8 @@ class Screen1 extends React.Component<Props> {
|
||||
onNavigatorEvent = (event: NavigatorEvent) => {
|
||||
if (event.id === 'willAppear') {
|
||||
console.log('will appear');
|
||||
} else if (event.type === 'NavBarButtonPress' && event.id === 'sideMenu') {
|
||||
console.log('side menu pressed');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user