Skip to main content

Installation

Follow these steps to install and configure React Native Date Picker in your project.

Step 1: Install the Package

Choose your preferred package manager:
npm install react-native-date-picker

Step 2: Install iOS Dependencies

If you’re using Expo, skip this step. Expo handles native dependencies automatically.
For non-Expo projects, you need to install CocoaPods dependencies:
cd ios && pod install
After the pod installation completes, navigate back to your project root:
cd ..

Step 3: Rebuild Your Project

After installing the package and dependencies, you must rebuild your project to link the native code.

For Expo Projects

This library requires custom native code and will NOT work with Expo Go. You must use Development Builds.
Build and run for each platform:
npx expo run:ios
Development Builds are custom versions of Expo Go that include your custom native code. Learn more in the Expo documentation.

For Non-Expo Projects

Build and run for each platform:
npx react-native run-ios

Verification

To verify the installation was successful, import the component in your app:
import DatePicker from 'react-native-date-picker'
If the import works without errors, you’re ready to use the date picker!

Troubleshooting

This package supports automatic linking. If you’re experiencing linking issues:For React Native >= 0.60:The package should link automatically. Try cleaning and rebuilding:
# iOS
cd ios && pod install && cd ..
npx react-native run-ios

# Android
cd android && ./gradlew clean && cd ..
npx react-native run-android
For React Native < 0.60:Run manual linking:
npx react-native link react-native-date-picker
If automatic linking fails, you may need to link manually. Check the GitHub issues for manual linking instructions.
If you’ve enabled Proguard for Android builds, you may experience crashes in production. Add these rules to your proguard-rules.pro file:
-keep public class net.time4j.android.ApplicationStarter
-keep public class net.time4j.PrettyTime
This prevents Proguard from obfuscating required classes.
This library cannot be used in the Expo Go app because it requires custom native code.Solution: Use Expo Development Builds instead:
  1. Install the package: npx expo install react-native-date-picker
  2. Create a development build: npx expo run:ios or npx expo run:android
  3. No config plugin is required
Learn more about Development Builds.
If you encounter build errors on iOS:
  1. Ensure you’re using Xcode >= 11.6
  2. Clean the build folder in Xcode (Cmd + Shift + K)
  3. Delete ios/Pods and ios/Podfile.lock
  4. Reinstall pods: cd ios && pod install && cd ..
  5. Rebuild: npx react-native run-ios
If you encounter build errors on Android:
  1. Clean the build:
    cd android && ./gradlew clean && cd ..
    
  2. Clear the cache:
    npx react-native start --reset-cache
    
  3. Rebuild:
    npx react-native run-android
    

Version Requirements

Make sure your project meets these minimum version requirements.
DependencyMinimum VersionNotes
React Native0.57For RN 0.64, use 0.64.2 or later
React17.0.1Peer dependency
Xcode11.6iOS development only
Expo SDK42For Expo SDK 44, use 44.0.4 or later

Next Steps

Now that you’ve installed the library, let’s create your first date picker:

Quick Start Guide

Learn how to implement your first date picker

Build docs developers (and LLMs) love