fix(components): Add "use client" directive to Toast (#2048)

Resolves #2025

This adds the "use client" directive to the Toast component, since it makes use of client-only features like `useState`. When absent, this causes errors in rendering as described in the issue.
This commit is contained in:
Gram Liu
2024-03-03 03:33:30 -08:00
committed by GitHub
parent a9f7b8d66d
commit 59412bbb08
6 changed files with 12 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,5 @@
"use client"
import * as React from "react"
import * as ToastPrimitives from "@radix-ui/react-toast"
import { cva, type VariantProps } from "class-variance-authority"

View File

@@ -1,3 +1,5 @@
"use client"
// Inspired by react-hot-toast library
import * as React from "react"

View File

@@ -1,3 +1,5 @@
"use client"
import * as React from "react"
import { Cross2Icon } from "@radix-ui/react-icons"
import * as ToastPrimitives from "@radix-ui/react-toast"

View File

@@ -1,3 +1,5 @@
"use client"
// Inspired by react-hot-toast library
import * as React from "react"