Skip to content

yaogengzhu/rn-picker-modal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>
  );
};

About

react-native-picker、support choose date

Resources

Stars

Watchers

Forks

Packages

No packages published