As per https://www.npmjs.com/package/react-native-wheel-scroll-picker
I did npm install react-native-wheel-scroll-picker --save
Then I copied the example into my App.js however...I get this error when I try to run it:
Unable to resolve "react-native-wheel-scroll-picker" from "App.js"
import React, {Component} from 'react';
import ScrollPicker from 'react-native-wheel-scroll-picker';
export default class SimpleExample extends Component {
render() {
return(
<ScrollPicker
dataSource={[
'a',
'b',
'c',
'd',
]}
selectedIndex={1}
renderItem={(data, index, isSelected) => {
//
}}
onValueChange={(data, selectedIndex) => {
//
}}
wrapperHeight={180}
wrapperWidth={150}
wrapperBackground={'#FFFFFF'}
itemHeight={60}
highlightColor={'#d8d8d8'}
highlightBorderWidth={2}
activeItemColor={'#222121'}
itemColor={'#B4B4B4'}
/>
)
}
}
UPDATE: ok new error, first I added to packages.json with
"react-native-wheel-scroll-picker": "0.2.4"
then I did the reset-cache, then i did npm start, then I get following error:
react-native-wheel-scroll-picker
is actually in yourpackage.json
and it's the version you expected? Second, have you checked that it's actually inroot/node_modules/react-native-wheel-scroll-picker
? Last, have you debugged your application to see what path it's resolving to? Maybe it doesn't matchroot/node_modules/react-native-wheel-scroll-picker
because you have some webpack configuration that overrides all^react-native*
packages or something, for example... there's a lot of things that could go wrong. – Patrick Robertsreact-native-dom
... very buggy since it's brand new. Though since you seem to be doing android development, you're probably not going to be deploying to web anyway. – Patrick Roberts