Skip to content

Commit

Permalink
fix: linting error caused by not enforcing key type for dictionary #140
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturoSalazarB16 authored Apr 29, 2024
1 parent 62f9a5f commit 9960a8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions components/navigation/navigationView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {ArrivalEvent, NavigationViewProps} from './types';
export default class NavigationView extends React.Component<NavigationViewProps> {
private viewId: number = -1;
private mapViewRef?: any;
private nativeEventsToCallbackMap;
private nativeEventsToCallbackMap: { [key: string] : (event: any) => void };

constructor(_props: NavigationViewProps) {
super(_props);
Expand Down Expand Up @@ -361,7 +361,10 @@ export default class NavigationView extends React.Component<NavigationViewProps>
);

for (const eventName of Object.keys(this.nativeEventsToCallbackMap)) {
eventEmitter.addListener(eventName, this.nativeEventsToCallbackMap[eventName]);
const listener = this.nativeEventsToCallbackMap[eventName];
if (listener != undefined) {
eventEmitter.addListener(eventName, listener);
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-navigation-sdk",
"version": "0.3.0-beta",
"version": "0.3.1-beta",
"author": "Google",
"description": "A react-native library for Google's Navigation SDK",
"private": false,
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"allowUnreachableCode": false,
"noImplicitAny": false,
"allowUnreachableCode": true,
"noImplicitAny": true,
"moduleSuffixes": [".android", ".ios", ""]
},
"include": [
Expand Down

0 comments on commit 9960a8a

Please sign in to comment.