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.

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)
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.
https://github.com/magus/react-native-facebook-login#setup
Still getting this issue
that because
FBLoginManager.Eventsis not actually defined for android currently