Skip to content

📚 Documentation: Error in React Tutorial Step 3 #150

Closed
@000-KunalPal

Description

@000-KunalPal

💭 Description

In the React tutorial under step 3, there is a mistake in the code snippet provided. Specifically, the export statement in line 9 exports database but in our step 7: Create ideas page, the import statement imports databases.

Current code:

import { Client, Databases, Account } from "appwrite";

const client = new Client();
client
  .setEndpoint("https://cloud.appwrite.io/v1")
  .setProject("<YOUR_PROJECT_ID>"); // Replace with your project ID

export const account = new Account(client);
export const database = new Databases(client);

Suggested correction:

import { Client, Databases, Account } from "appwrite";

const client = new Client();
client
  .setEndpoint("https://cloud.appwrite.io/v1")
  .setProject("<YOUR_PROJECT_ID>"); // Replace with your project ID

export const account = new Account(client);
export const databases = new Databases(client);

This adjustment ensures that the code functions as expected.

Steps to Reproduce:

  1. Go to the SvelteKit tutorial step 3.
  2. Follow the provided code snippet.

Expected Behavior:
The code provided should be accurate and functional.

Additional Information:
Documentation URL: https://appwrite.io/docs/tutorials/react/step-3

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

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions