error: bundling failed: Error: Unable to resolve module
hoist-non-react-statics
fromE:\DEVELOPMENTWORKSPACE\test\node_modules\react-native-calendars\src\expandableCalendar\asCalendarConsumer.js
: Modulehoist-non-react-statics
does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
watchman watch-del-all
.node_modules
folder: rm -rf node_modules && npm install
.rm -rf /tmp/metro-bundler-cache-*
or npm start -- --reset-cache
.rm -rf /tmp/haste-map-react-native-packager-*
.import { Calendar, CalendarList, Agenda } from 'react-native-calendars'; All parameters for components are optional. By default the month of current local date will be displayed. Parameters that require date types accept YYYY-MM-DD formatted date-strings , JavaScript date objects, calendar objects and UTC timestamps .
import React, { Component } from 'react'; import { StyleSheet, Text, View } from 'react-native'; import CalendarPicker from 'react-native-calendar-picker'; export default class App extends Component { constructor(props) { super(props); this. state = { selectedStartDate: null, selectedEndDate: null, }; this.
The problem is that src/expandableCalendar/asCalendarConsumer.js is trying to import 'hoist-non-react-statics' which is not declared as a dependency in package.json So the solution is to add it in package.json as this:
"dependencies": {
"lodash": "^4.0.0",
"prop-types": "^15.5.10",
"xdate": "^0.8.0",
"hoist-non-react-statics": "*"},
than run npm install
run react-native run-ios
and you're up to go!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With