Skip to content

Commit 9960a8a

Browse files
fix: linting error caused by not enforcing key type for dictionary #140
1 parent 62f9a5f commit 9960a8a

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

components/navigation/navigationView/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {ArrivalEvent, NavigationViewProps} from './types';
4141
export default class NavigationView extends React.Component<NavigationViewProps> {
4242
private viewId: number = -1;
4343
private mapViewRef?: any;
44-
private nativeEventsToCallbackMap;
44+
private nativeEventsToCallbackMap: { [key: string] : (event: any) => void };
4545

4646
constructor(_props: NavigationViewProps) {
4747
super(_props);
@@ -361,7 +361,10 @@ export default class NavigationView extends React.Component<NavigationViewProps>
361361
);
362362

363363
for (const eventName of Object.keys(this.nativeEventsToCallbackMap)) {
364-
eventEmitter.addListener(eventName, this.nativeEventsToCallbackMap[eventName]);
364+
const listener = this.nativeEventsToCallbackMap[eventName];
365+
if (listener != undefined) {
366+
eventEmitter.addListener(eventName, listener);
367+
}
365368
}
366369
};
367370

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-navigation-sdk",
3-
"version": "0.3.0-beta",
3+
"version": "0.3.1-beta",
44
"author": "Google",
55
"description": "A react-native library for Google's Navigation SDK",
66
"private": false,

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"forceConsistentCasingInFileNames": true,
1919
"noFallthroughCasesInSwitch": true,
2020
"noImplicitOverride": true,
21-
"allowUnreachableCode": false,
22-
"noImplicitAny": false,
21+
"allowUnreachableCode": true,
22+
"noImplicitAny": true,
2323
"moduleSuffixes": [".android", ".ios", ""]
2424
},
2525
"include": [

0 commit comments

Comments
 (0)