HosseinShabani / react-native-modern-datepicker

A customizable calendar, time & month picker for React Native (including Persian Jalaali calendar & locale)
MIT License
577 stars 165 forks source link

Check the render method of `Calendar`. #84

Open zzy-33 opened 2 years ago

zzy-33 commented 2 years ago

hi, Whenever I open this page, it will prompt me to introduce Calendar an error

Error:

Error: Element type is invalid: expected a string (for built-in components) 
or a class/function (for composite components) but got: undefined. 
You likely forgot to export your component from the file it's defined in,
or you might have mixed up default and named imports.

Check the render method of `Calendar`.

and this my code:

import DatePicker from 'react-native-modern-datepicker';

  const [selectedDate, setSelectedDate] = useState('');

<>
     <DatePicker
        mode="calendar"
        onSelectedChange={date => setSelectedDate(date)}
      />
</>
malek75 commented 2 years ago

Hi, Did someone find a way to solve this ? Many thanks

zzy-33 commented 2 years ago

Hi, Did someone find a way to solve this ? Many thanks I copied the current package, and then modified the import method like the following old

import {Header, Days} from '.';

change

import { Header } from './Header';
import { Days } from './Days';

I modified the import method and it worked

maybe try

malek75 commented 2 years ago

It works fine! Thanks @zzy-33

hatn98 commented 2 years ago

It works like a charm!!!. Thanks

sanjeevkse commented 1 year ago

@zzy-33 Where to modify it?

malek75 commented 1 year ago

/components/Calendar.js

sam9010 commented 1 year ago

@sanjeevkse it is in this \node_modules\react-native-modern-datepicker\src\datePicker\components\Calendar.js