react-native-facebook-login: Cannot read property 'Events' of undefined

After setting up react-native-facebook-login in my project, and running my project, I get the following error. simulator screen shot apr 18 2016 5 14 25 pm

When navigating to the line mentioned in the error, I can see that FBLoginManager is not a property on NativeModules from React.

File node_modules/react-native-facebook-login/index.ios.js

var React = require('react-native');
var {
  View,
  StyleSheet,
  PropTypes,
  NativeModules,
  requireNativeComponent,
  NativeMethodsMixin,
  DeviceEventEmitter,
} = React;

var { FBLoginManager } = NativeModules;

var FBLogin = React.createClass({
  statics: {
    Events: FBLoginManager.Events,
  },

In my application, all I do to to reproduce this issue, is to import the module: import FBLogin from 'react-native-facebook-login';

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 19 (1 by maintainers)

Most upvoted comments

I also have this problem before. And the way I managed to solve it is to rebuild the project using react-native run-ios.

Hope it can help.

Still getting this issue

that because FBLoginManager.Events is not actually defined for android currently