react-native-modern-datepicker
react-native-modern-datepicker copied to clipboard
Check the render method of `Calendar`.
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)}
/>
</>
Hi, Did someone find a way to solve this ? Many thanks
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
It works fine! Thanks @zzy-33
It works like a charm!!!. Thanks
@zzy-33 Where to modify it?
/components/Calendar.js
@sanjeevkse it is in this \node_modules\react-native-modern-datepicker\src\datePicker\components\Calendar.js