Skip to content

Commit

Permalink
Add deprecation notice to SwipeableListView
Browse files Browse the repository at this point in the history
Summary: ListView is deprecated and SwipeableListView uses ListView. Thus, it is deprecated as well.

Reviewed By: RSNara

Differential Revision: D10437408

fbshipit-source-id: a08391d5b099e74b6ec179cd940ac404b2e702f4
  • Loading branch information
elicwhite authored and facebook-github-bot committed Oct 18, 2018
1 parent 5e997f9 commit 99471f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Libraries/react-native/react-native-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
const invariant = require('fbjs/lib/invariant');

let showedListViewDeprecation = false;
let showedSwipeableListViewDeprecation = false;

// Export React, plus some native additions.
module.exports = {
Expand Down Expand Up @@ -119,6 +120,14 @@ module.exports = {
return require('SwipeableFlatList');
},
get SwipeableListView() {
if (!showedSwipeableListViewDeprecation) {
console.warn(
'ListView and SwipeableListView are deprecated and will be removed in a future release. ' +
'See https://fb.me/nolistview for more information',
);

showedSwipeableListViewDeprecation = true;
}
return require('SwipeableListView');
},
get TabBarIOS() {
Expand Down

0 comments on commit 99471f8

Please sign in to comment.