1.2.0 • Published 4 years ago
@latticeframe/react-native-wheel v1.2.0
@latticeframe/react-native-wheel
Getting started
yarn: yarn add @latticeframe/react-native-wheel
npm: npm install @latticeframe/react-native-wheel --save
Mostly automatic installation
react-native link @latticeframe/react-native-wheel
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNWheelPackage;
to the imports at the top of the file - Add
new RNWheelPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:
include ':latticeframe_react-native-wheel' project(':latticeframe_react-native-wheel').projectDir = new File(rootProject.projectDir, '../node_modules/@latticeframe/react-native-wheel/android')```
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:implementation project(':latticeframe_react-native-wheel')
Usage
Base usage
import { WheelPanel } from 'react-native-wheel';
...
<WheelPanel
style={...}
title='title'
options={...}
value={...}
onValueChange={...}
/>
...
Example
Properties
style
Type: text styles
Picker panel handle's style, or use children props replace it
visible
Type: boolean
Picker panel is visible
title
Type: string
Picker panel title
options
Type: [[{label: string, value: string | number}]]
One or multip options
value
Type: Array<string | number>
Current value
onValueChange
Type: (value: Array<string | number>) => void
original wheel usage
Properties
style
Type: text styles
Wheel's style
options
Type: [{label: string, value: string | number}]
Wheel's options
value
Type: string | number
Current value
onValueChange
Type: (value: string | number) => void