Skip to content

Commit

Permalink
Add Deprecation Warning to ListView
Browse files Browse the repository at this point in the history
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
  • Loading branch information
elicwhite authored and facebook-github-bot committed Oct 9, 2018
1 parent 5512c47 commit e90f5fa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Libraries/react-native/react-native-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

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

let showedListViewDeprecation = false;

// Export React, plus some native additions.
const ReactNative = {
// Components
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit e90f5fa

Please sign in to comment.