JSPM

react-native-picker-scrollview-custom

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q17914F
  • License MIT

a pure js picker, each option item customizable

Package Exports

  • react-native-picker-scrollview-custom

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-picker-scrollview-custom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-native-picker-scrollview

a pure js picker, each option item customizable

example

usage

npm install react-native-picker-scrollview --save
import React, {Component} from 'react';
import ScrollPicker from 'react-native-picker-scrollview';

export default class SimpleExample extends Component {

    render() {
        return(
            <ScrollPicker
                ref={(sp) => {this.sp = sp}}

                dataSource={[
                    'a',
                    'b',
                    'c',
                    'd',
                ]}
                selectedIndex={0}
                itemHeight={50}
                wrapperHeight={250}
        wrapperColor={'#ffffff'}
                highlightColor={'#d8d8d8'}
                renderItem={(data, index, isSelected) => {
                    return(
                        <View>
                            <Text >{data}</Text>
                        </View>
                    )
                }}
                onValueChange={(data, selectedIndex) => {
                    //
                }}
            />
        )
    }


    //
    someOtherFunc(){
        this.sp.scrollToIndex(2);   // select 'c'
        let selectedValue = this.sp.getSelected();  // returns 'c'
    }
}