Skip to content

content: Missing Event type when trying to subscribe to 'ionBackButton' with React. #4261

@Fep310

Description

@Fep310

URL

https://ionicframework.com/docs/developing/hardware-back-button

Issue Description

When trying to subscribe to 'ionBackButton' the way it is written on the docs, the compiler complains about the property detail with the message: "Property 'detail' does not exist on type 'Event'.ts(2339)".

The current solution is to cast the event parameter to any. Other solutions have been tried, like casting to BackButtonEvent from @ionic/react or @ionic/core.

Image below is how I found the current solution on the Ionic discord:
Image

npm ls:

├── @capacitor-community/[email protected]
├── @capacitor-community/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @capacitor/[email protected]
├── @ionic/[email protected]
├── @ionic/[email protected]
├── @ionic/[email protected]
├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @vitejs/[email protected]
├── @vitejs/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentIssues related to the contents of the documentation website

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions