From 6249d14a61723b22deb1336457b4295978471885 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Mon, 3 Feb 2020 02:17:19 -0800 Subject: [PATCH] Lean Core: add removed message for ToolbarAndroid (#27930) Summary: Add warning message for development that is trying to use ToolbarAndroid that has been removed from ReactNative in 0.61 Ref: https://github.com/facebook/react-native/issues/26591 ## Changelog [General] [Deprecated] - Add warning message for trying to use ToolbarAndroid which has been removed from the core. Pull Request resolved: https://github.com/facebook/react-native/pull/27930 Differential Revision: D19690581 Pulled By: cpojer fbshipit-source-id: 8e404fe62651fba4940199c74c45270d6e853740 --- index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.js b/index.js index e9b7b659f60aee..0831f7a6a4a6f4 100644 --- a/index.js +++ b/index.js @@ -576,6 +576,19 @@ if (__DEV__) { }, }); + // $FlowFixMe This is intentional: Flow will error when attempting to access ToolbarAndroid. + Object.defineProperty(module.exports, 'ToolbarAndroid', { + configurable: true, + get() { + invariant( + false, + 'ToolbarAndroid has been removed from React Native. ' + + "It can now be installed and imported from '@react-native-community/toolbar-android' instead of 'react-native'. " + + 'See https://github.com/react-native-community/toolbar-android', + ); + }, + }); + // $FlowFixMe This is intentional: Flow will error when attempting to access ViewPagerAndroid. Object.defineProperty(module.exports, 'ViewPagerAndroid', { configurable: true,