Skip to content

Commit

Permalink
Lean Core: add warnings for extracted components (facebook#27929)
Browse files Browse the repository at this point in the history
Summary:
Add warning messages for Clipboard, SegmentedControlIOS, ProgressViewIOS, ProgressBarAndroid that has been published in community repo.

## Changelog

[General] [Deprecated] - Add deprecation warnings for Clipboard, SegmentedControlIOS, ProgressViewIOS, ProgressBarAndroid.
Pull Request resolved: facebook#27929

Test Plan: yarn lint

Differential Revision: D19690577

Pulled By: cpojer

fbshipit-source-id: d53fbe9980c5eb2f7b62deb397064aa727d513bd
  • Loading branch information
Naturalclar authored and osdnk committed Mar 9, 2020
1 parent 07547ff commit 03a3892
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,21 @@ module.exports = {
return require('./Libraries/Components/Picker/PickerIOS');
},
get ProgressBarAndroid(): ProgressBarAndroid {
warnOnce(
'progress-bar-android-moved',
'ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/progress-bar-android' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-progress-bar-android',
);
return require('./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid');
},
get ProgressViewIOS(): ProgressViewIOS {
warnOnce(
'progress-view-ios-moved',
'ProgressViewIOS has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/progress-view' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-progress-view',
);
return require('./Libraries/Components/ProgressViewIOS/ProgressViewIOS');
},
get SafeAreaView(): SafeAreaView {
Expand All @@ -198,6 +210,12 @@ module.exports = {
return require('./Libraries/Lists/SectionList');
},
get SegmentedControlIOS(): SegmentedControlIOS {
warnOnce(
'segmented-control-ios-moved',
'SegmentedControlIOS has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/segmented-control' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-segmented-control',
);
return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS');
},
get Slider(): Slider {
Expand Down Expand Up @@ -281,6 +299,12 @@ module.exports = {
return require('./Libraries/Utilities/BackHandler');
},
get Clipboard(): Clipboard {
warnOnce(
'clipboard-moved',
'Clipboard has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/clipboard' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-clipboard',
);
return require('./Libraries/Components/Clipboard/Clipboard');
},
get DatePickerAndroid(): DatePickerAndroid {
Expand Down

0 comments on commit 03a3892

Please sign in to comment.