question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

undefined is not an object (evaluating "RNCalendarEvents.authorizationStatus")

See original GitHub issue

React 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

  1. import RNCalendarEvents from ‘react-native-calendar-events’;
  2. var RNCalendarEvents = NativeModules.RNCalendarEvents; (after importing NativeModules from react-native)
  3. var { RNCalendarEvents } = require(‘NativeModules’)
  4. 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:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
martincarreracommented, Aug 25, 2017

Hey @majd-kho, I was having the same issue that you have.

Ensure that you have this three libs linked in Xcode, build phases.

screen shot 2017-08-25 at 12 37 56 pm

I hope this helps!

2reactions
reilemcommented, Aug 30, 2017

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

null is not an object (evalutating 'RNCalendarEvents ...
I'm trying to put an event in Calendar phone with this package "import RNCalendarEvents from 'react-native ...
Read more >
React Native: undefined is not an object (evaluating '_this ...
Hi everybody, I have a react-native app created with RN CLI, using react-native 0.63, I'm trying to use SectionList but I'm getting the ......
Read more >
react-native-calendar-events - npm
React Native Calendar Events. React Native Module for accessing and saving events to iOS and Android calendars.
Read more >
iOS : React Native, NavigatorIOS, undefined is not an object ...
iOS : React Native, NavigatorIOS, undefined is not an object ( evaluating 'this.props.navigator.push') [ Beautify Your Computer ...
Read more >
undefined is not an object (evaluating 'device.id') in ... - YouTube
ERROR TypeError: undefined is not an object ( evaluating 'device.id')Please do like share and comment if you like the video please do hit ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found