react-native-modern-datepicker icon indicating copy to clipboard operation
react-native-modern-datepicker copied to clipboard

Check the render method of `Calendar`.

Open zzy-33 opened this issue 2 years ago • 7 comments

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)}
      />
</>

zzy-33 avatar Nov 21 '21 16:11 zzy-33

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

malek75 avatar Dec 10 '21 12:12 malek75

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

zzy-33 avatar Dec 13 '21 07:12 zzy-33

It works fine! Thanks @zzy-33

malek75 avatar Dec 13 '21 14:12 malek75

It works like a charm!!!. Thanks

hatn98 avatar Sep 26 '22 10:09 hatn98

@zzy-33 Where to modify it?

sanjeevkse avatar Feb 17 '23 13:02 sanjeevkse

/components/Calendar.js

malek75 avatar Feb 17 '23 14:02 malek75

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

sam9010 avatar Mar 26 '23 09:03 sam9010