react-native-color-picker icon indicating copy to clipboard operation
react-native-color-picker copied to clipboard

Warning: Slider has been extracted from react-native core and will be removed in a future release

Open smartcris opened this issue 5 years ago • 10 comments

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

smartcris avatar Jan 25 '20 12:01 smartcris

you can use it now via sliderComponent props in 0.5.0

sodik82 avatar Feb 02 '20 14:02 sodik82

@sodik82 I am still getting a warning, even when I do provide this prop. Screenshot 2020-02-05 at 12 58 08

My Code:

import { ColorPicker, toHsv, fromHsv } from 'react-native-color-picker';
import Slider from '@react-native-community/slider';
// ...

<ColorPicker
	sliderComponent={Slider}
	color={headColor}
	style={{ flex: 1 }} />

fritzfr avatar Feb 05 '20 11:02 fritzfr

can you try with 0.5.1?

sodik82 avatar Feb 08 '20 21:02 sodik82

@sodik82 Yip, worked. Thanks!

fritzfr avatar Feb 12 '20 09:02 fritzfr

@sodik82 Actually I have to reopen, the issue still persists. It was only gone shortly but the warning is back on every reload of my app. Same stack trace as above.

fritzfr avatar Feb 13 '20 09:02 fritzfr

same goes to me .. but when using trianglecolerpicker the error do not pop out when everytime I reload the app

@sodik82 Actually I have to reopen, the issue still persists. It was only gone shortly but the warning is back on every reload of my app. Same stack trace as above.

ridzwanari avatar Jun 10 '22 09:06 ridzwanari

you can use it now via sliderComponent props in 0.5.0

Thanks, I added

import Slider from '@react-native-community/slider'; <ColorPicker sliderComponent={Slider} .. />

and it works

oleksii-jointoit avatar Sep 19 '22 11:09 oleksii-jointoit

I made a post earlier saying that I had figured out how to add the react-native-community slider and then set the color on it by providing this as the sliderComponent

const renderSliderComponent = () => {
    return (
      <View>
        <Slider 
          minimumTrackTintColor={theme.colors.medium}
        />
      </View>
    )
  }

However, I realized that providing it this way changes the color of the slider but then the sliders stop working. Is there any props that I can add that would make it so that the sliders still work?

Jake-Mulhern avatar Oct 13 '22 21:10 Jake-Mulhern

@Jake-Mulhern - you need to pass prop to the slider so that it can work

(props) => .... <Slider {...props} color="yellow"/>

sodik82 avatar Oct 14 '22 12:10 sodik82

you need to pass prop to the slider so that it can work

(props) => .... <Slider {...props} color="yellow"/>

@sodik82 when I pass {...props} in to the component it breaks the sliders. They are just stuck in the same location and won't move even if I don't pass the minimumTrackTintColor in as another prop.

When I log the props being passed in I get this.

{
  "onValueChange": [Function bound ],
  "value": 1,
}
Object {
  "onValueChange": [Function bound ],
  "value": 0.4823529411764706,
}

Jake-Mulhern avatar Oct 14 '22 20:10 Jake-Mulhern