Require cycle and CalendarProvider import gives undefined
See original GitHub issueDescription
Can’t use CalendarProvider because of an error
Expected Behavior
I expect normal working but got the error
Observed Behavior
Got the error on the app start
WARN: Require cycle:
index.js ->
App.tsx ->
node_modules/react-native-calendars/src/index.js ->
node_modules/react-native-calendars/src/expandableCalendar/Context/Provider.js ->
index.js
ERROR Warning: React.createElement: 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 your code at Provider.js:147.
in CalendarProvider (at App.tsx:96)
in RCTView (at View.js:34)
in View (at App.tsx:95)
in App (at renderApplication.js:47)
in RCTView (at View.js:34)
in View (at AppContainer.js:107)
in RCTView (at View.js:34)
in View (at AppContainer.js:134)
in AppContainer (at renderApplication.js:40)
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 `CalendarProvider`.
This error is located at:
in CalendarProvider (at App.tsx:96)
in RCTView (at View.js:34)
in View (at App.tsx:95)
in App (at renderApplication.js:47)
in RCTView (at View.js:34)
in View (at AppContainer.js:107)
in RCTView (at View.js:34)
in View (at AppContainer.js:134)
in AppContainer (at renderApplication.js:40), js engine: hermes
Environment
npm ls react-native-calendars
: react-native-calendars@1.1264.0npm ls react-native
: react-native@0.64.0
Also specify:
- Device/emulator/simulator & OS version: Android 9 real device
Reproducible Demo
import React from 'react';
import { View} from 'react-native';
import { CalendarProvider, ExpandableCalendar } from 'react-native-calendars';
export function App({}: Props) {
return (
<View>
<CalendarProvider>
<ExpandableCalendar />
</CalendarProvider>
</View>
);
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:11
Top Results From Across the Web
Require cycles are allowed, but can result in uninitialized ...
All imported stuff from B is undefined. ... to solve: In your case the warning also gives a detailed explanation, where the cycle...
Read more >Calendars API - Fitbit SDK
Type: CalendarProvider. The Calendar API allows developers to retrieve events from user's calendars. import calendars from "calendars"; let start = new ...
Read more >Best way to avoid this require cycle? [Redux] : r/reactjs - Reddit
I can't think of a way to get rid of the require cycle without creating a new one. ... Don't have the Axios...
Read more >react-native-calendars | Yarn - Package Manager
This module includes various customizable React-Native calendar components. The package is both Android and iOS compatible. See our new Docs site. Try it...
Read more >NG3003: Import cycles would need to be created to compile ...
A component, directive, or pipe that is referenced by this component would require the compiler to add an import that would lead to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same error on version 1.1278.0 (latest at the moment)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.