From 25a3cff5a71b8f04a613f5987b90a56a82b960e8 Mon Sep 17 00:00:00 2001 From: Eli White Date: Tue, 9 Oct 2018 16:20:13 -0700 Subject: [PATCH] Add Deprecation Warning to ListView Summary: This component has long been deprecated in the docs. Adding a warning to the code. Reviewed By: sahrens Differential Revision: D10261155 fbshipit-source-id: 462ce30a97f35e52477cfc135fb50c976b56e9cb --- Libraries/react-native/react-native-implementation.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Libraries/react-native/react-native-implementation.js b/Libraries/react-native/react-native-implementation.js index 3ff7b9ed3b4..0de0089d883 100644 --- a/Libraries/react-native/react-native-implementation.js +++ b/Libraries/react-native/react-native-implementation.js @@ -12,6 +12,8 @@ const invariant = require('fbjs/lib/invariant'); +let showedListViewDeprecation = false; + // Export React, plus some native additions. const ReactNative = { // Components @@ -58,6 +60,14 @@ const ReactNative = { return require('KeyboardAvoidingView'); }, get ListView() { + if (!showedListViewDeprecation) { + console.warn( + 'ListView is deprecated and will be removed in a future release. ' + + 'See https://fb.me/nolistview for more information', + ); + + showedListViewDeprecation = true; + } return require('ListView'); }, get MaskedViewIOS() {