From a9ab7afebf6e38bdb7654f255fa947ee92c863d0 Mon Sep 17 00:00:00 2001 From: Devansh Mahant <86195162+devansh-m12@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:45:29 -0700 Subject: [PATCH] Fix Incorrect Hook Import Path in Toast Component Example in ShadCN Docs (#4811) #### Summary: This pull request addresses a documentation error found in the ShadCN website's Toast component example. Specifically, the import route for the hook is incorrect in the example. and fixes [#4816](https://github.com/shadcn-ui/ui/issues/4816) #### Issue: Upon reviewing the [ShadCN Toast documentation](https://ui.shadcn.com/docs/components/toast), I found that the import path for the Toast component hook was wrongly mentioned as being located in the `components` folder. According to the `component.json` file, the correct location of the hook is within the `hooks` folder inside the main directory. #### Fix: - Corrected the import path in the Toast component example from `components` to `hooks`, as per the `component.json` file structure. #### Example of Fix: **Before:** ```js import { useToast } from "@/components/use-toast"; ``` **After:** ```js import { useToast } from "@/hooks/use-toast"; ``` #### Testing: - Verified that the corrected path resolves correctly. - Ensured the example works as expected after the change. #### Impact: This fix prevents confusion for users following the example and ensures that the import path accurately reflects the project structure, improving the overall developer experience. --- apps/www/content/docs/components/toast.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/www/content/docs/components/toast.mdx b/apps/www/content/docs/components/toast.mdx index f772be60ca..87b6c45dec 100644 --- a/apps/www/content/docs/components/toast.mdx +++ b/apps/www/content/docs/components/toast.mdx @@ -104,7 +104,7 @@ export default function RootLayout({ children }) { The `useToast` hook returns a `toast` function that you can use to display a toast. ```tsx -import { useToast } from "@/components/hooks/use-toast" +import { useToast } from "@/hooks/use-toast" ``` ```tsx {2,7-10}