rn-picker-modal
v1.1.0
Published
react-native-picker-modal、support wheel
Downloads
4
Maintainers
Readme
rn-picker-modal
一个简单的rn-picker-modal
组件
yarn add rn-picker-modal
基础用法
import { DatePicker } from 'rn-picker-modal'
const Index = () => {
const dateRef = useRef();
const [date, setDate] = useState(new Date());
return (
<SafeAreaView style={{flex: 1}}>
<DatePicker
ref={dateRef}
date={date}
onConfirm={v => {
setDate(v)
}}
/>
<Button
title="open"
onPress={() => {
dateRef.current.toggleModal();
}}
/>
</SafeAreaView>
);
};
演示
import { Wheel } from 'rn-picker-modal'
import { View, SafeAreaView } from 'react-native'
const Index = () => {
const dateRef = useRef();
return (
<SafeAreaView style={{flex: 1}}>
<View>
<Wheel data={[1, 2, 3]}>
</View>
</SafeAreaView>
);
};