BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
939 stars 327 forks source link

minDate is not working proparly #204

Closed GunjanSkry closed 4 years ago

GunjanSkry commented 4 years ago

When I set minDate prop, I am getting following error,

undefined is not an object (evaluating 's[Math.min(u+o-1,s.length-1)].date')

Here is a snack example which produces this error, (https://snack.expo.io/@gunjans/react-native-calendar-strip)

peacechen commented 4 years ago

Thanks @GunjanSkry for the reproducible Snack. The state in Scroller.js wasn't properly initialized in this case. I pushed a fix that you can try out by pointing to this repo directly in package.json. Run npm install after changing it.

  "dependencies": {
    "react-native-calendar-strip": "https://github.com/BugiDev/react-native-calendar-strip",
    ...
  }
GunjanSkry commented 4 years ago

I have tried the way mention above, I removed node_modules and changed package.json, but I am still getting that error in my project.

peacechen commented 4 years ago

npm often has problems with caching when pulling from a Github repo. Use these steps to clear the cache:

  1. Delete node_modules.
  2. npm install
  3. npm start -- --reset-cache
  4. Break out of that after it starts the packager: Ctrl-C.
  5. Start the app with npm start (or react-native run-... for native projects).

The --reset-cache flag requires @react-native-community/cli-tools:

npm install @react-native-community/cli-tools --global

peacechen commented 4 years ago

The fix has been published in 2.0.7