From f3b8c5362ad40c4fe4c2517f47c7879d8d8a6093 Mon Sep 17 00:00:00 2001 From: orangemug Date: Sun, 20 Oct 2019 12:25:43 +0100 Subject: [PATCH] Remove shouldComponentUpdate because mapbox-gl will do the diff for us, so updates will no longer diff twice. --- src/components/map/MapboxGlMap.jsx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/components/map/MapboxGlMap.jsx b/src/components/map/MapboxGlMap.jsx index ba33fc2..d5b221f 100644 --- a/src/components/map/MapboxGlMap.jsx +++ b/src/components/map/MapboxGlMap.jsx @@ -94,16 +94,6 @@ export default class MapboxGlMap extends React.Component { } } - shouldComponentUpdate(nextProps, nextState) { - let should = false; - try { - should = JSON.stringify(this.props) !== JSON.stringify(nextProps) || JSON.stringify(this.state) !== JSON.stringify(nextState); - } catch(e) { - // no biggie, carry on - } - return should; - } - componentDidUpdate(prevProps) { if(!IS_SUPPORTED) return;