我第一次使用应用程序写入,但在身份验证用户(注册)期间显示错误,所以这里有什么问题?
import { Account, Client, ID } from 'react-native-appwrite';
export const config = {
endPoint: "https://cloud.appwrite.io/v1",
platform: 'xyx',
projectId: 'xyx',
databaseId: 'xyx',
userCollectionId: 'xyx',
videoCollectionId: 'xyx',
storageId: 'xyx'
}
const client = new Client();
client
.setEndpoint(config.endPoint)
.setProject(config.projectId)
.setPlatform(config.platform)
;
const account = new Account(client);
export const CreateUser = () => {
account.create(ID.unique(), '[email protected]', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
}
检查您导入 createUser 函数的文件...应该像这样导入
从“”导入{createUser};不像这样 import createUser from "";