Skip to content

Commit f295d7f

Browse files
Naturalclarfacebook-github-bot
authored andcommitted
Lean Core: add warnings for extracted components (#27929)
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: #27929 Test Plan: yarn lint Differential Revision: D19690577 Pulled By: cpojer fbshipit-source-id: d53fbe9980c5eb2f7b62deb397064aa727d513bd
1 parent 6249d14 commit f295d7f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

index.js

+24
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,21 @@ module.exports = {
183183
return require('./Libraries/Components/Picker/PickerIOS');
184184
},
185185
get ProgressBarAndroid(): ProgressBarAndroid {
186+
warnOnce(
187+
'progress-bar-android-moved',
188+
'ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. ' +
189+
"It can now be installed and imported from '@react-native-community/progress-bar-android' instead of 'react-native'. " +
190+
'See https://github.com/react-native-community/react-native-progress-bar-android',
191+
);
186192
return require('./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid');
187193
},
188194
get ProgressViewIOS(): ProgressViewIOS {
195+
warnOnce(
196+
'progress-view-ios-moved',
197+
'ProgressViewIOS has been extracted from react-native core and will be removed in a future release. ' +
198+
"It can now be installed and imported from '@react-native-community/progress-view' instead of 'react-native'. " +
199+
'See https://github.com/react-native-community/react-native-progress-view',
200+
);
189201
return require('./Libraries/Components/ProgressViewIOS/ProgressViewIOS');
190202
},
191203
get SafeAreaView(): SafeAreaView {
@@ -198,6 +210,12 @@ module.exports = {
198210
return require('./Libraries/Lists/SectionList');
199211
},
200212
get SegmentedControlIOS(): SegmentedControlIOS {
213+
warnOnce(
214+
'segmented-control-ios-moved',
215+
'SegmentedControlIOS has been extracted from react-native core and will be removed in a future release. ' +
216+
"It can now be installed and imported from '@react-native-community/segmented-control' instead of 'react-native'. " +
217+
'See https://github.com/react-native-community/react-native-segmented-control',
218+
);
201219
return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS');
202220
},
203221
get Slider(): Slider {
@@ -281,6 +299,12 @@ module.exports = {
281299
return require('./Libraries/Utilities/BackHandler');
282300
},
283301
get Clipboard(): Clipboard {
302+
warnOnce(
303+
'clipboard-moved',
304+
'Clipboard has been extracted from react-native core and will be removed in a future release. ' +
305+
"It can now be installed and imported from '@react-native-community/clipboard' instead of 'react-native'. " +
306+
'See https://github.com/react-native-community/react-native-clipboard',
307+
);
284308
return require('./Libraries/Components/Clipboard/Clipboard');
285309
},
286310
get DatePickerAndroid(): DatePickerAndroid {

0 commit comments

Comments
 (0)