roto93 / react-native-neat-date-picker

An easy to use date picker for react native.
MIT License
50 stars 29 forks source link

Suggestions #34

Open erenkulaksiz opened 2 months ago

erenkulaksiz commented 2 months ago

Hello,

I have several suggestions. I loved this library for its year selection so i wanted to point out some things.

  1. all data types needs to be refactored, because onConfirm date is only object. Yeah it is an object, but it has some keys as documentation says.
  2. turn everything to functions instead of functional component (const).
  3. allow developers to pass custom translations.
  4. On NeatDatePicker.tsx line 150, there is typescript error.
  5. PLEASE PLEASE use useMemo --- on every date change, react re renders all date numbers, this causes performance issues such as low fps because set state rerenders, but rendering components with usememo doesnt cause them to rerender.
  6. you can go forward even when maxDate selected on year select modal?
  7. dateStringFormat needs to revisited, no need for long array of possible strings, just use replace with {DAY} and stuff.
  8. documentation needs to be refactored because some data types wrong or missing

These are all that came up to my mind. I didnt wanted to mess with library itself so i copied to my locale and heavly customized the library for my needs.

erenkulaksiz commented 2 months ago
  1. Add ok button to year modal. Also, remove the content component its unneccesary.
ioasjfopas commented 2 months ago
  1. Allow passing a color for dates that are disabled by minDate or maxDate.

(Awesome library by the way, that's a ton : ))