React-Native(世博会)应用程序。遵循文档,无法导入 LoginKit。
导入时,LoginKit 返回 null,例如:
import { View, Text, TouchableOpacity } from "react-native";
import React, { useContext } from "react";
import { AuthContext } from "../contexts/AuthContext";
import { LoginKit } from "@snapchat/snap-kit-react-native";
export default function EditProfilePicture() {
const authCtx = useContext(AuthContext);
console.log(LoginKit); // prints as null
return (
<View>
<TouchableOpacity onPress={() => LoginKit.login()}>
<Text>LOGIN</Text>
</TouchableOpacity>
</View>
);
}
当然,当按下按钮时:
// Cannot read property 'login' of null
我已按照此处文档的说明进行操作:https://docs.snap.com/snap-kit/login-kit/Tutorials/react-native
我尝试重新安装软件包
什么都不起作用。