Closed nachiket-asbuilt closed 3 years ago
@nachiket-asbuilt, make sure that you have typescript
pkg installed.
If not, just complete npm i typescript -g
or yarn global add typescript
sorry, for incovenience. In between, try to install version 0.5
instead.
npm i react-native-color-picker@0.5
@nachiket-asbuilt - can you try to install latest version again?
@sodik82 it installed now but i can only see slider no circle or triangle colour picker.
@nachiket-asbuilt, make sure that you have
typescript
pkg installed. If not, just completenpm i typescript -g
oryarn global add typescript
@dmko1610 i tried it but got same error.
I have tried our example app with latest expo and both android phone and ios simulator and it worked fine.
do you have enough space for color picker - i.e. used eg. flex:1
or set enought height
for your picker component?
Thanks. It installed now but i am unable to change height or any style of the picker. Sorry but i'm new to react native. Can you please share your code snippet?
My code:
const Home = (props) => {
return (
<ColorPicker
onColorSelected={(color) => alert(Color selected: ${color}
)}
style={{ flex: 1, height: 500 }}
/>
);
};
and following is the output.
well, it looks almost correct :) there is something with width - you can try to set it explicitly. but usually the better way (than explicitly setting width/height) is to use flexbox https://reactnative.dev/docs/flexbox
color picker uses all the space the user/programmer will provide to it. so you just need to properly layout your components.
I tried to install using following command but while installing getting error and can not use the color picker. command:- "npm i react-native-color-picker" I'm using expo. ![Uploading Screenshot 2020-08-24 at 9.51.26 PM.png…]![Screenshot 2020-08-24 at 9 52 46 PM](https://user-images.githubusercontent.com/54387180/91031059-2a53d580-e654-11ea-85d0-04bfa1cfbbbd.png)