Add deprecation warning while importing Slider component (#23385)

Summary:
Introducing the deprecation warning for those who are importing `Slider` component (https://github.com/facebook/react-native/issues/23313)

[General] [Deprecated] - Deprecated Slider as it has now been moved to `react-native-community/slider`
Pull Request resolved: https://github.com/facebook/react-native/pull/23385

Differential Revision: D14029819

Pulled By: cpojer

fbshipit-source-id: 7ad257124756c6bee57c3fbb1a056c09e8cc29a1
This commit is contained in:
michalchudziak 2019-02-11 13:31:34 -08:00 committed by Facebook Github Bot
parent ffe37487b2
commit bf888a7582
1 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,12 @@ module.exports = {
return require('SegmentedControlIOS'); return require('SegmentedControlIOS');
}, },
get Slider() { get Slider() {
warnOnce(
'slider-moved',
'Slider 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/slider' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-slider',
);
return require('Slider'); return require('Slider');
}, },
get SnapshotViewIOS() { get SnapshotViewIOS() {