Issue
So I was adding Facebook login into my app and I was following the documentation for Ionic v4,
https://ionicframework.com/docs/v4/native/facebook/
and I was getting an error when adding the Facebook
item from the import in the constructor parameters.
import { Facebook, FacebookLoginResponse } from '@ionic-native/facebook/ngx';
constructor(private fb: Facebook) { }
private fb: Facebook
is throwing a 'Facebook' refers to a value, but is being used as a type here. Did you mean 'typeof Facebook'?
error.
I'm sure it's just a syntax error, but I don't know the proper syntax.
Solution
As of TypeScript 3.8 it is possible to use Type-Only Imports. To make sure the imported parameter is not a value, but a type do this:
import type { Facebook } from '@ionic-native/facebook/ngx';
Answered By - robalem
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.