undefined is not an object (evaluating "RNCalendarEvents.authorizationStatus")
See original GitHub issueReact native version 0.46
I have installed the the module and linked it, but whenever i try to run this piece of code (below) i get this error message “undefined is not an object (evaluating “RNCalendarEvents.authorizationStatus”)”
RNCalendarEvents.authorizationStatus()
.then(status => {
console.log(status)
})
.catch(error => {
console.log(error)
});
whats interesting is that its referencing the “authorizationStatus index.ios.js:10:28” file righ under the error message as the cause, but im using a create-react-native-app project to render on the expo app.
Note: im running this piece of code from within componentDidMount method
Update This is what i’ve tried based on this previous closed issue #28
- import RNCalendarEvents from ‘react-native-calendar-events’;
- var RNCalendarEvents = NativeModules.RNCalendarEvents; (after importing NativeModules from react-native)
- var { RNCalendarEvents } = require(‘NativeModules’)
- import RNCalendarEvents from “…/RNCalendarEvents”;
contents of RNCalendarEvents.js from point 4
use strict';
import { NativeModules } from 'react-native';
var RNCalendarEvents = NativeModules.RNCalendarEvents;
export default RNCalendarEvents;
and the error message i would get is “undefined is not an object (evaluating “_RNCalendarEvents2.default.authorizationStatus”)”
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Hey @majd-kho, I was having the same issue that you have.
Ensure that you have this three libs linked in Xcode, build phases.
I hope this helps!
@martincarrera I just had the same issue and this fixed it, thank you very much. I had already tried
react-native link
and that didn’t work.