Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.js to import react-native-fbsdk-next #68

Closed
wants to merge 1 commit into from
Closed

Update index.js to import react-native-fbsdk-next #68

wants to merge 1 commit into from

Conversation

KrisLau
Copy link

@KrisLau KrisLau commented Jul 6, 2021

The example is using react-native-fbsdk instead of react-native-fbsdk-next so I just thought I'd update that. It still doesn't run for me (see #21) but I thought I'd help out where I can for now as I do not know how to resolve the InvariantViolation

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

@KrisLau
Copy link
Author

KrisLau commented Jul 6, 2021

Copying my comment over from #21 here as it might be pertinent:

Ok so I found out more things but still can't fully resolve the error. For some reason named imports from 'react-native' aren't recognized so changing all the import {a, b} from 'react-native' to

import a from 'react-native'
import b from 'react-native'

For example:

import { requireNativeComponent, StyleSheet } from 'react-native';

turns into

import requireNativeComponent from 'react-native';
import StyleSheet from 'react-native';

Also replaced JSX.Element; in FBLoginButton.ts to React.JSX.Element

This gets rid of a bunch of errors but leaves me with this error:

[Tue Jul 06 2021 09:41:54.464]  BUNDLE  example/index.js 

[Tue Jul 06 2021 09:42:01.667]  ERROR    TypeError: undefined is not a function (near '..._reactNative.default.create...')
[Tue Jul 06 2021 09:42:01.667]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Tue Jul 06 2021 09:42:01.686]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

which I can't seem to figure our what to do for that

@mikehardy
Copy link
Collaborator

Yeah when I saw the state of the example app, I wept.
Nothing frustrates me more than spending more than about 10 seconds on keeping an example app running.
I will post a PR in about an hour so with an auto-generation script for example apps a la https://github.com/react-native-device-info/react-native-device-info/blob/master/refresh-example.sh and/or https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

@KrisLau
Copy link
Author

KrisLau commented Jul 6, 2021

Yeah when I saw the state of the example app, I wept.
Nothing frustrates me more than spending more than about 10 seconds on keeping an example app running.
I will post a PR in about an hour so with an auto-generation script for example apps a la https://github.com/react-native-device-info/react-native-device-info/blob/master/refresh-example.sh and/or https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

@mikehardy Yeah I probably spent a little too long on it considering I couldn't get it to work anyway 😆 Thank you for everything you do to maintain this library btw, I really appreciate it!

@mikehardy
Copy link
Collaborator

@KrisLau it exists - works for me on my machine ? #69

@github-actions
Copy link

github-actions bot commented Sep 7, 2021

🎉 This issue has been resolved in version 4.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants