Issues implementing Facebook login with React-native

Viewed 618

I am trying to follow the guide here: https://developers.facebook.com/docs/react-native/login to get facebook login working on my app. I have literally copied and pasted the simple version into a file like this:

    import React, { Component } from 'react';
import{
  View
} from 'react-native';

const FBSDK = require('react-native-fbsdk');
const {
  LoginButton,
} = FBSDK;

var Login = React.createClass({
  render: function() {
    return (
      <View>
        <LoginButton
          publishPermissions={['publish_actions']}
          onLoginFinished={
            (error, result) => {
              if (error) {
                alert('Login failed with error: ' + result.error);
              } else if (result.isCancelled) {
                alert('Login was cancelled');
              } else {
                alert('Login was successful with permissions:'  + result.grantedPermissions)
              }
            }
          }
          onLogoutFinished={() => alert('User logged out')}/>
      </View>
    );
  }
});
export default class FacebookLogin extends Component {
render(){
  return (
    <Login />
  );
}

}

However recieve the following error on the ios simulator:

Unable to resolve module prop-types from {redacted}/node_modules/react-native-fbsdk/js/FBLikeView.js: Module does not exist in the module map or in these directories: {project}/node_modules

Any ideas on how to proceed?

I tried reinstalling node modules and resetting the cache but I seem blocked.

2 Answers
Related