DEV Community


Enter date easily with react-native-datefield

tuantvk profile image tuantvk ・1 min read

In the course of implementing a few projects, I have found that users who use the selection date function in applications often have difficulty choosing years in the past.

Hence, I developed the react-native-datefield library to make it easier for the users to enter date data.
The react-native-datefield library has great support in terms of both user interface and functional performance. It validates the entered date data, leap years, allows customization of layout input and returns errors if the user enters incorrect data.


  • DateMonthYearField
  • MonthDateYearField
  • YearMonthDateField


import DateField from 'react-native-datefield';
Enter fullscreen mode Exit fullscreen mode


const DateField = require('react-native-datefield');
Enter fullscreen mode Exit fullscreen mode
  labelDate='Enter date'
  labelMonth='Enter month'
  labelYear='Enter year'
  defaultValue={new Date()}
  onSubmit={(value) => console.log(value)}

  onSubmit={(value) => console.log('MonthDateYearField', value)}

  onSubmit={(value) => console.log('YearMonthDateField', value)}

const styles = StyleSheet.create({
  inputBorder: {
    width: '30%',
    borderRadius: 8,
    borderColor: '#cacaca',
    borderWidth: 1,
    marginBottom: 20,
Enter fullscreen mode Exit fullscreen mode

View more example App.tsx.

My repo on Github react-native-datefield

Thanks for reading !

Discussion (0)

Forem Open with the Forem app