From afbacace24e76f58bd3318f01dfff462293a0295 Mon Sep 17 00:00:00 2001 From: streamich Date: Sun, 17 Feb 2019 09:14:25 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20typings=20in=20useO?= =?UTF-8?q?rientation=20sensor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/useOrientation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/useOrientation.ts b/src/useOrientation.ts index eb6bf3df..ebaa363d 100644 --- a/src/useOrientation.ts +++ b/src/useOrientation.ts @@ -26,7 +26,7 @@ const useOrientation = (initialState: OrientationState = defaultState) => { setState({angle, type}); } else if (window.orientation) { setState({ - angle: window.orientation, + angle: typeof window.orientation === 'number' ? window.orientation : 0, type: '' }); } else {