Skip to content

BeforeEvent#getNavigationTarget() should return Class<? extends Component> #23221

@stefanuebe

Description

@stefanuebe

Describe your motivation

The navigation target returned by the BeforeEvent returns a generic Class<?>. Since the navigation target in Flow applications is always a Component, this does not make sense and requires the dev to add an unnecessary cast to Class<Component> (or <? extends Component>`) plus suppressed warnings.

Describe the solution you'd like

BeforeEvent#getNavigationTarget() should return Class<? extends Component>` instead.

Additional context

Since this might be a breaking change, it most likely is something for V26, but could be considered for an implementation in a minor, since current usages most likely will have a cast applied or are already assigned to a Class<?> variable.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done / Pending Release

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions