본문 바로가기
front-end/React Native

[RN]휠 픽커 'react-native-wheel-pick'

by -제이리 2023. 1. 10.
728x90
320x100

https://github.com/TronNatthakorn/react-native-wheel-pick

 

GitHub - TronNatthakorn/react-native-wheel-pick

Contribute to TronNatthakorn/react-native-wheel-pick development by creating an account on GitHub.

github.com

 아이템 및 날짜를 선택할때 유용한 라이브러리

 

 

설치

npm install react-native-wheel-pick --save --legacy-peer-deps
npm install @react-native-picker/picker --save --legacy-peer-deps
npm install @react-native-community/datetimepicker --save --legacy-peer-deps
npx pod-install

 

 

사용방법

import { Picker, DatePicker } from 'react-native-wheel-pick';

// use Picker
<Picker
  style={{ backgroundColor: 'white', width: 300, height: 215 }}
  selectedValue='item4'
  pickerData={['item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7']}
  onValueChange={value => { console.log(value) }}
/>

// use DatePicker
<DatePicker
  style={{ backgroundColor: 'white', width: 370, height: 240 }} 
  onDateChange={date => { console.log(date) }}
/>
728x90
320x100

댓글