Skip to content

Commit e90f5fa

Browse files
elicwhitefacebook-github-bot
authored andcommitted
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
1 parent 5512c47 commit e90f5fa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Libraries/react-native/react-native-implementation.js

+10
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
const invariant = require('fbjs/lib/invariant');
1414

15+
let showedListViewDeprecation = false;
16+
1517
// Export React, plus some native additions.
1618
const ReactNative = {
1719
// Components
@@ -58,6 +60,14 @@ const ReactNative = {
5860
return require('KeyboardAvoidingView');
5961
},
6062
get ListView() {
63+
if (!showedListViewDeprecation) {
64+
console.warn(
65+
'ListView is deprecated and will be removed in a future release. ' +
66+
'See https://fb.me/nolistview for more information',
67+
);
68+
69+
showedListViewDeprecation = true;
70+
}
6171
return require('ListView');
6272
},
6373
get MaskedViewIOS() {

0 commit comments

Comments
 (0)