appwrite / sdk-for-react-native

[READ ONLY] Official Appwrite React Native SDK 💙 ⚛︎
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
3.78k stars 21 forks source link

📚 Documentation: need to import relevant class to create user without an error #20

Open RuwanPradeep0 opened 6 months ago

RuwanPradeep0 commented 6 months ago

💭 Description

import { Client, Account } from 'react-native-appwrite';
// Init your React Native SDK
const client = new Client();

client
    .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
    .setProject('455x34dfkj')
    .setPlatform('com.example.myappwriteapp') // YOUR application ID
;

const account = new Account(client);

// Register User
account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')
    .then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });   

in here instant of using

import { Client, Account } from 'react-native-appwrite'; 

need to use

import { Client, Account ,ID } from 'react-native-appwrite';

if not ID.unique() will not be work properly

👀 Have you spent some time to check if this issue has been raised before?

🏢 Have you read the Code of Conduct?

docimin commented 1 month ago

I'm guessing you ment this blog post? https://appwrite.io/blog/post/introducing-appwrite-react-native-sdk

This seems to be fixed. I could not find any other references.