diff --git a/src/map.tsx b/src/map.tsx index 71670b4e4..31c01e265 100644 --- a/src/map.tsx +++ b/src/map.tsx @@ -237,10 +237,10 @@ export default class ReactMapboxGl extends React.Component { // Check for equality + !!fitBounds.filter((c, i) => { // Check for equality const nc = nextProps.fitBounds && nextProps.fitBounds[i]; return c[0] !== (nc && nc[0]) || c[1] !== (nc && nc[1]); - }) + })[0] ); if (didFitBoundsUpdate) { diff --git a/src/util/diff.ts b/src/util/diff.ts index 9d2a6739a..2272adc68 100644 --- a/src/util/diff.ts +++ b/src/util/diff.ts @@ -1,7 +1,7 @@ const reduce = require('reduce-object'); // tslint:disable-line const find = (obj: any, predicate: (...args: any[]) => boolean) => ( - Object.keys(obj).find((key) => predicate(obj[key], key)) + Object.keys(obj).filter((key) => predicate(obj[key], key))[0] ); const diff = (obj1: any, obj2: any) => ( diff --git a/tsconfig.json b/tsconfig.json index dd0b9faf5..47e730588 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "outDir": "lib", "module": "commonjs", - "target": "es6", + "target": "es5", "sourceMap": true, "moduleResolution": "node", "rootDirs": ["src"],