Compilation error when passing a callback to onDidDismiss / onWillDismiss methods of overlay based components
See original GitHub issueBug Report
Ionic Info
Run ionic info
from a terminal/cmd prompt and paste the output below.
Ionic:
ionic (Ionic CLI) : 4.1.0 (/Users/max/.nvm/versions/node/v8.9.3/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.6
@angular-devkit/core : 0.7.3
@angular-devkit/schematics : 0.7.3
@angular/cli : 6.1.3
@ionic/ng-toolkit : 1.0.7
@ionic/schematics-angular : 1.0.5
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 5.0.12
NodeJS : v8.9.3 (/Users/max/.nvm/versions/node/v8.9.3/bin/node)
npm : 6.4.0
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000
Environment:
ANDROID_HOME : /Users/max/Library/Android/sdk
Describe the Bug After update to 4.0.0-beta.6 code that uses overlay based components such as Modals and Alerts does not compile when a callback is passed to onDidDismiss or onWillDismiss methods.
The following error is displayed:
error TS2554: Expected 0 arguments, but got 1.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Compilation error when passing a callback to onDidDismiss ...
6 code that uses overlay based components such as Modals and Alerts does not compile when a callback is passed to onDidDismiss or...
Read more >How to pass data on click to modal's backdrop to receive in ...
So I will post here how I did resolve this problem and received modal's data on onDidDismiss function on modal's invoker page:.
Read more >@ionic/core | Yarn - Package Manager
Ionic is based on Web Components, which enables significant performance, usability, and feature improvements alongside support for popular web frameworks ...
Read more >Creating Powerful Components with Angular CDK
In this article, we'll learn how to use the Angular CDK overlay feature to create powerful components. We'll accomplish this by creating a ......
Read more >Using overlay hooks in Ionic React to display ... - YouTube
In this short tutorial, I take you through the new Overlay Hooks that were introduced in version 5.6 of the Ionic Framework.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I also had this issue, solved it by using:
Change
.onDidDismiss((data) => {
to.onDidDismiss().then((data) => {
The documentation lacks some information about this, but I can understand because its still in beta 😉
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.