Comments (4)
I have an issue too using '@react-native-community/slider' as sliderComponent. I don't get a crash but i think there is indeed an issue with the typechecking of sliderComponent props.
Here's an extract of my code :
<ColorPicker
style={{ flex: 1 }}
defaultColor={newColor}
onColorChange={color => setNewColor(fromHsv(color))}
// not working for now - seems to be an error in code of the package - see latest issue in package
sliderComponent={(props: any) => (
<SliderComponent
value={props.value}
onValueCange={() => props.onValueChange()}
/>
)}
/>
My SliderComponent get the value prop.
However, the onValueChange prop doesn't seem to work because when I slide, none of the "v" / "s" value are changing.
from react-native-color-picker.
@Frakette Do you use typescript in your project?
This is just a type error issue which means it compiles and works. Only my IDE is complaining.
SliderComponent isn't customized, is it? So just add the component class like so:
<ColorPicker ...sliderComponent={SliderComponent }
this should work if i get you right
from react-native-color-picker.
@Hektar90 Yes I use typescript on my project. Actually my issue might not be fully related to yours but I also see a Typescript error when I try to add a sliderComponent.
I was struggling to pass props to my SliderComponent because I was passing it directly as a component and it was not working but as a function that returns a component it works although the slider is a bit glitchy.
However, as you noticed, I still get get the same Typescript error than you when passing SliderComponent.
I ended up using a //@ts-expect-error to avoid compilation errors. But a correction on the type checking would be great :)
from react-native-color-picker.
Any update in this issue? I have the same problem
from react-native-color-picker.
Related Issues (20)
- Outer circle missing with RN62 HOT 1
- Restrict colors for picker HOT 1
- sliderComponent HOT 2
- Customize colorPreview button/s in TriangleColorPicker HOT 3
- Not Giving Colors Except Black Color
- custom button and props for TriangleColorPicker HOT 3
- TriangleColorPicker rotating with flickering on IOS HOT 5
- IPicker type declarations problem HOT 2
- Can't install properly HOT 8
- xcode 12 -Ios14 -colorpicker triangle single color inside triangle
- Center color circle loose circle shape when defining 'oldColor' params HOT 2
- Holo color picker outer circle missing on ios
- Setting "color" property breaks outer circle selection HOT 3
- Change Slider Colors HOT 1
- How to label the sliders HOT 1
- Fixed the issue for future release of React Native (removal of Slider extracted from react-native)
- Slider import from react native resolved HOT 2
- Add Black Color Option
- Warning: Picker has been extracted from react-native core and will be removed in a future release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-color-picker.