Skip to content

bug: ModalOptions no longer accepts a Type parameter #31012

Description

@Ionaru

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Using this code:

import { ModalOptions } from '@ionic/angular';

const modal = await this.modalController.create({
  component: MyModalComponent,
} satisfies ModalOptions<typeof MyModalComponent>);

It errors:

[ERROR] TS2315: Type 'ModalOptions' is not generic.

Expected Behavior

This code:

import { ModalOptions } from '@ionic/angular';

const modal = await this.modalController.create({
  component: MyModalComponent,
} satisfies ModalOptions<typeof MyModalComponent>);

Should not error and correctly verify that component is MyModalComponent

Steps to Reproduce

N/A

Code Reproduction URL

N/A

Ionic Info

N/A

Additional Information

Bug introduced in #30899, specifically in commit 641f319.

Ionic 8.8.0 was the first version with this bug.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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