Package Exports
- expo-datepicker
- expo-datepicker/lib/index.js
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 (expo-datepicker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
expo-datepicker
expo-datepicker is a beautiful and simple datepicker for react native and expo
Installation
npm i expo-datepicker
yarn add expo-datepicker
Example
import React, { useState } from "react";
import { StyleSheet, Text, View, ViewStyle } from "react-native";
import DatePicker from "expo-datepicker";
import { Entypo } from "@expo/vector-icons";
export default function App() {
const [date, setDate] = useState(new Date().toString());
return (
<View style={styles.container}>
<DatePicker
date={date}
onChange={(date) => setDate(date)}
icon={<Entypo name="chevron-right" size={40} color="#689CA3" />}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
Properties
Property | Description |
---|---|
date | Current date selected |
icon | Icon |
fontStyle | Input text style |
containerStyle | Container Style |
Events
Property | Description |
---|---|
onChange | (date:string)=>void |
License
MIT
Free Software, Hell Yeah!