From 34c5a9aa7a1dd28cd9283f1d6d4256ffcf026ee5 Mon Sep 17 00:00:00 2001 From: Akash Santra Date: Thu, 7 May 2026 12:24:18 +0530 Subject: [PATCH] docs: improve React quickstart with error handling and fix Docker capitalization (#45320) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## I have read the CONTRIBUTING.md file. YES ## What kind of change does this PR introduce? Docs update ## What is the current behavior? - The React quickstart example does not handle errors when fetching data. - The local development guide uses inconsistent capitalization for "docker". ## What is the new behavior? - Adds basic error handling (`error` check) in the React quickstart example to improve reliability. - Fixes capitalization from "docker" → "Docker" for consistency with official naming. ## Additional context These are small improvements to enhance clarity and developer experience in the docs. ## Summary by CodeRabbit * **Documentation** * Enhanced React quickstart guide with error handling for database queries to prevent invalid data processing * Corrected capitalization in local development guide --- .../guides/getting-started/quickstarts/reactjs.mdx | 8 +++++++- apps/docs/content/guides/local-development.mdx | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/docs/content/guides/getting-started/quickstarts/reactjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/reactjs.mdx index a4dc3776d47..66d9743c162 100644 --- a/apps/docs/content/guides/getting-started/quickstarts/reactjs.mdx +++ b/apps/docs/content/guides/getting-started/quickstarts/reactjs.mdx @@ -102,7 +102,13 @@ hideToc: true }, []); async function getInstruments() { - const { data } = await supabase.from("instruments").select(); + const { data, error } = await supabase.from("instruments").select(); + + if (error) { + console.error(error); + return; + } + setInstruments(data); } diff --git a/apps/docs/content/guides/local-development.mdx b/apps/docs/content/guides/local-development.mdx index 872f486567e..6b9490c59cf 100644 --- a/apps/docs/content/guides/local-development.mdx +++ b/apps/docs/content/guides/local-development.mdx @@ -116,7 +116,7 @@ As a prerequisite, you must install a container runtime compatible with Docker A -If your local development machine is connected to an untrusted public network, you should create a separate docker network and bind to 127.0.0.1 before starting the local development stack. This restricts network access to only your localhost machine. +If your local development machine is connected to an untrusted public network, you should create a separate Docker network and bind to 127.0.0.1 before starting the local development stack. This restricts network access to only your localhost machine. ```sh docker network create -o 'com.docker.network.bridge.host_binding_ipv4=127.0.0.1' local-network