### Start Metro Server (npm) Source: https://github.com/henninghall/react-native-date-picker/blob/master/examples/Rn073/README.md Starts the Metro bundler using npm. This is required before starting the application. ```bash npm start ``` -------------------------------- ### Start Metro Server (Yarn) Source: https://github.com/henninghall/react-native-date-picker/blob/master/examples/Rn073/README.md Starts the Metro bundler using Yarn. This is required before starting the application. ```bash yarn start ``` -------------------------------- ### Install and Run iOS/Android Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/README.md Troubleshoots installation issues by ensuring native dependencies are installed and the app is run correctly. ```bash cd ios && pod install && cd .. npx react-native run-ios # or run-android ``` -------------------------------- ### Installation Errors Solution Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/quick-reference.md Troubleshoot installation errors by ensuring pods are installed and running the correct native build commands. ```bash # iOS cd ios && pod install && cd .. # All platforms npx react-native run-ios npx react-native run-android ``` -------------------------------- ### Install and Rebuild React Native Date Picker Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/README.md Install the package using npm and then run pod install for iOS. Rebuild the application for both iOS and Android. ```bash # Install npm install react-native-date-picker cd ios && pod install && cd .. # Rebuild npx react-native run-ios npx react-native run-android ``` -------------------------------- ### Install React Native Date Picker Source: https://github.com/henninghall/react-native-date-picker/blob/master/README.md Install the library using npm, yarn, or pnpm. ```sh # npm npm install react-native-date-picker # yarn yarn add react-native-date-picker # pnpm pnpm add react-native-date-picker ``` -------------------------------- ### Install react-native-date-picker Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/quick-reference.md Install the package using npm and run native builds for iOS and Android. ```bash npm install react-native-date-picker cd ios && pod install && cd .. npx react-native run-ios npx react-native run-android ``` -------------------------------- ### Install Specific Version Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/version-guide.md Install a specific version of react-native-date-picker, for example, v4.11.0. ```bash npm install react-native-date-picker@4.11.0 ``` -------------------------------- ### getInstallationErrorMessage() Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/api-reference/utilities.md Provides platform-specific installation error messages to guide users through troubleshooting native module linking issues. ```APIDOC ## getInstallationErrorMessage() ### Description Returns platform-specific installation instructions to help users resolve issues with the native module installation. ### Returns String with installation steps for the current platform: **iOS (Non-Expo):** ``` react-native-date-picker is not installed correctly. Make sure you: 1. Installed pods (by for instance running 'cd ios && pod install') 2. Rebuilt the app (by for instance 'npx react-native run-ios') ... ``` **iOS (Expo):** ``` react-native-date-picker is not installed correctly. Make sure you: 1. Have rebuilt your app (with for instance 'npx expo run:ios') 2. Are not using Expo Go (Expo Go is unsupported)... ``` **Android (Non-Expo):** ``` react-native-date-picker is not installed correctly. Make sure you: 1. Rebuilt the app (by for instance 'npx react-native run-android') ... ``` **Android (Expo):** ``` react-native-date-picker is not installed correctly. Make sure you: 1. Have rebuilt your app (with for instance 'npx expo run:android') 2. Are not using Expo Go (Expo Go is unsupported)... ``` ``` -------------------------------- ### Troubleshoot Installation: Clear Cache and Reinstall Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/version-guide.md Steps to resolve installation errors by clearing the npm cache, removing node modules and lock files, and then reinstalling and rebuilding the project. ```bash # Clear cache npm cache clean --force rm -rf node_modules package-lock.json # Reinstall npm install # Rebuild npx react-native run-android # or run-ios ``` -------------------------------- ### Start iOS Application (npm) Source: https://github.com/henninghall/react-native-date-picker/blob/master/examples/Rn073/README.md Launches the React Native application on an iOS simulator using npm. ```bash npm run ios ``` -------------------------------- ### Start Metro Server Source: https://github.com/henninghall/react-native-date-picker/blob/master/examples/Rn072/README.md Start the Metro bundler, which is essential for running React Native applications. Use either npm or Yarn. ```bash # using npm npm start # OR using Yarn yarn start ``` -------------------------------- ### Install iOS Pods Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/version-guide.md Command to install iOS dependencies after updating the package. ```bash cd ios && pod install && cd .. ``` -------------------------------- ### Install v5.0.13 Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/version-guide.md Command to install version 5.0.13 of react-native-date-picker. ```bash npm install react-native-date-picker@5.0.13 ``` -------------------------------- ### Installation Error Handling with DatePicker Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/errors.md Demonstrates how to conditionally render a fallback UI if the DatePicker's native modules fail to load during installation. This prevents app crashes by catching potential errors. ```jsx import React, { useState } from 'react' import { Text, View } from 'react-native' import DatePicker from 'react-native-date-picker' export default function SafeApp() { const [date, setDate] = useState(new Date()) const [error, setError] = useState(null) // In your setup code, you can catch installation issues React.useEffect(() => { try { // Try to use the date picker // If native module is missing, this will throw } catch (e) { setError(e.message) } }, []) if (error) { return Error: {error} } return } ``` -------------------------------- ### Install react-native-date-picker with npm Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/errors.md Follow these steps to install the package using npm, install iOS pods, and rebuild your project for Expo and non-Expo applications. ```bash # 1. Install the package npm install react-native-date-picker # 2. Install iOS pods (iOS/Expo only) cd ios && pod install && cd .. # 3. Rebuild the project # For Expo projects: npx expo run:ios npx expo run:android # For non-Expo projects: npx react-native run-ios npx react-native run-android ``` -------------------------------- ### Modal Date Picker Example Source: https://github.com/henninghall/react-native-date-picker/blob/master/_autodocs/README.md Demonstrates how to implement a modal date picker. Use this pattern when you need a user to explicitly confirm their selection. ```jsx const [date, setDate] = useState(new Date()) const [open, setOpen] = useState(false)