react-native-datetimepicker / datetimepicker

React Native date & time picker component for iOS, Android and Windows
MIT License
2.53k stars 413 forks source link

Datetimepicker styling - plugin wasn't shipped with new release #922

Closed malas123 closed 3 months ago

malas123 commented 3 months ago

Bug report

Summary

I need to style datetime component in react native. I am using Expo. The datetimepicker library is installed via command: npx expo install u/react-native-community/datetimepicker

According to this document styling of the datetime component is possible through plugins object of app.json document. However, I get following error:

"Package "@react-native-community/datetimepicker" does not contain a valid config plugin.

Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Cannot use import statement outside a module"

I think the issue is missing plugin files in npm package

Reproducible sample code

Steps to reproduce

  1. Add styling configuration to app.json as described in the documentation
  2. Run npx expo prebuild -p android --clean

Describe what you expected to happen:

  1. The build should finish without errors. New styling should be applied
  2. ā€¦

Environment info

Expo version: 0.18.14 npx react-native info output:

# paste it here
System:
  OS: Windows 10 10.0.19045
  CPU: "(16) x64 AMD Ryzen 7 3700X 8-Core Processor             "
  Memory: 6.50 GB / 15.93 GB
Binaries:
  Node:
    version: 20.13.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 10.8.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
IDEs:
  Android Studio: AI-233.14808.21.2331.11709847
  Visual Studio:
    - 17.7.34031.279 (Visual Studio Community 2022)
    - 16.11.34601.136 (Visual Studio Community 2019)
Languages:
  Java:
    version: 20.0.2
    path: C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
  Ruby: Not Found
  "@react-native-community/cli": Not Found
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.1
    wanted: 0.74.1
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
maukoese commented 3 months ago

Got the same issue as well

usaidpeerzada commented 3 months ago

Same issue, any fixes?

vonovak commented 3 months ago

Hello and thanks for reporting, the plugin files are present in version 8.2.0, as you can see here https://www.npmjs.com/package/@react-native-community/datetimepicker?activeTab=code

You need to install this version (or newer) and then run npx expo prebuild in order to apply the color settings.

Thank you šŸ™‚