Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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