Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethercreative/react-native-date-input
A simple React Native date input component that uses DatePickerAndroid and DatePickerIOS to select dates
https://github.com/ethercreative/react-native-date-input
Last synced: about 2 months ago
JSON representation
A simple React Native date input component that uses DatePickerAndroid and DatePickerIOS to select dates
- Host: GitHub
- URL: https://github.com/ethercreative/react-native-date-input
- Owner: ethercreative
- License: mit
- Created: 2019-09-10T12:19:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T14:35:27.000Z (over 4 years ago)
- Last Synced: 2024-05-01T18:08:31.166Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 9
- Watchers: 8
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-date-input
A simple React Native date input component that uses `DatePickerAndroid` and `DatePickerIOS` to select dates
## Installation
```
yarn add react-native-date-input dayjs react-native-appearance react-native-iphone-x-helper
cd ios && pod install
```## Usage
```js
import React, { useState } from 'react';
import { DateInput } from 'react-native-date-input';
import dayjs from 'dayjs';export default (props) => {
const [date, setDate] = useState('');
let dateInput = null;const handleChange = (date) => {
setDate(date);
};const focus = () => {
if (!dateInput) {
return;
}dateInput.focus();
};return (
(dateInput = input)}
/>
);
};
```