From 523ab8333800afbfb169c6fd70ab6611fe07cc2a Mon Sep 17 00:00:00 2001 From: Eli White Date: Wed, 18 Sep 2019 18:32:27 -0700 Subject: [PATCH] Add deprecation warning to AccessibilityInfo.fetch Summary: This was already deprecated, but without a message. Reviewed By: zackargyle, ejanzer Differential Revision: D17180347 fbshipit-source-id: 44aa5d1821e56f7600033e82062c4661fe663471 --- .../Components/AccessibilityInfo/AccessibilityInfo.android.js | 3 +++ .../Components/AccessibilityInfo/AccessibilityInfo.ios.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js index b44c2a6fb220bb..e2db8ab1eab23e 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js @@ -91,6 +91,9 @@ const AccessibilityInfo = { * Same as `isScreenReaderEnabled` */ get fetch(): () => Promise { + console.warn( + 'AccessibilityInfo.fetch is deprecated, call Accessibility.isScreenReaderEnabled instead', + ); return this.isScreenReaderEnabled; }, diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js index 9a86653d452849..c82b3e31b374ed 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js @@ -165,6 +165,9 @@ const AccessibilityInfo = { * Same as `isScreenReaderEnabled` */ get fetch(): $FlowFixMe { + console.warn( + 'AccessibilityInfo.fetch is deprecated, call Accessibility.isScreenReaderEnabled instead', + ); return this.isScreenReaderEnabled; },