2

I need a Wheel styled picker ( which is available for iOS as the default Picker ) on Android and iOS. I'm using expo and hence I cannot use any native packages available out there.

Is it possible to use pure javascript package with react native?

I tried this library but getting an error:

cannot find self

while importing.

Is it really possible to use a library like this or is there anything I'm missing??

1
  • If your question has been answered, please consider marking the correct answer, if not, please add more info so that others can help you or help others in future visits to this post. Commented Nov 13, 2018 at 13:46

3 Answers 3

9

Sorry, but no, you cannot use react components written for the web in react-native. Those libraries use HTML for their markup and CSS for the styling. React-Native uses none of those, so it will obviously not know how to display them.

So I guess that the only option is to search for some library written for react-native (Like the one already suggested) or build one yourself.

Sign up to request clarification or add additional context in comments.

Comments

0

Have a look at this library: react-native-picker

This library is a Wheel styled picker alternative for your issue.

Install it with:

npm install react-native-picker --save

And use it like this:

import Picker from 'react-native-picker';

<Picker
    style={{
        height: 300
    }}
    showDuration={300}
    showMask={true}
    pickerData={[1,2,3,4]}
    selectedValue={3}
/>

Comments

-1

No. becuase react-native ui work different than web

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.