Skip to content

bug: <IonToast> class property has Typescipt issue #3550

Closed
@Mati-Educa

Description

@Mati-Educa

Describe the Bug

When you want to use 'class' property on the IonToast you've got this Typescript error:

Type '{ trigger: string; duration: number; message: string; class: string; buttons: { text: string; role: "cancel"; }[]; }' is not assignable to type 'IntrinsicAttributes & IonToast & Omit<HTMLAttributes<HTMLIonToastElement>, "style" | "placeholder"> & IonicReactProps & RefAttributes<...>'.
  Property 'class' does not exist on type 'IntrinsicAttributes & IonToast & Omit<HTMLAttributes<HTMLIonToastElement>, "style" | "placeholder"> & IonicReactProps & RefAttributes<...>'. Did you mean 'className'?

Documentation: https://ionicframework.com/docs/api/toast#theming

Expected Behavior

You can use the 'class' property without any typescript error.

Steps to Reproduce

  1. Go to the documentation: Ionic documentation
  2. Click on the StackBlitz button: StackBlitz
  3. Check the class property error.

Screenshots

image

Operating System

Windows 11

Browser

Chrome & Edge

Version

Version 122.0.6261.131 (Official Build) (64-bit)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions