bug: Deprecation warnings with the ion-split-pane
See original GitHub issueBug Report
Ionic version:
[x] 4.x
Current behavior:
deprecation warnings Expected behavior:
none Steps to reproduce:
Related code:
<ion-app>
<ion-split-pane>
<ion-menu class="dark">
<ion-header class="ion-text-center dark" no-border>
<ion-toolbar color="dark">
<ion-title item-center class="dark ion-text-center">
<img src="assets/company-logo.svg" alt="imagen de la compañia" />
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="dark">
<ion-list class="dark" lines="none" mode="ios">
<ion-menu-toggle auto-hide="false" *ngFor="let p of appPages">
<ion-item [routerDirection]="'root'" [routerLink]="[p.url]" color="dark">
<ion-icon slot="start" [src]="p.icon"></ion-icon>
<ion-label>
{{ p.title }}
</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-list>
</ion-content>
</ion-menu>
<ion-router-outlet main></ion-router-outlet>
</ion-split-pane>
</ion-app>
Other information:
the warning instructions are pretty lack-luster as whenever I try to follow the instructions it fails to compile because I need to have a main
for the slide action to listen on. According to the warning it should be this way;
<ion-app>
<ion-split-pane contentId="main-content">
<ion-menu class="dark" contentId="my-content">
<ion-header class="ion-text-center dark" no-border>
<ion-toolbar color="dark">
<ion-title item-center class="dark ion-text-center">
<img src="assets/company-logo.svg" alt="imagen de la compañia" />
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="dark">
<ion-list class="dark" lines="none" mode="ios">
<ion-menu-toggle auto-hide="false" *ngFor="let p of appPages">
<ion-item [routerDirection]="'root'" [routerLink]="[p.url]" color="dark">
<ion-icon slot="start" [src]="p.icon"></ion-icon>
<ion-label>
{{ p.title }}
</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-list>
</ion-content>
</ion-menu>
<ion-router-outlet main></ion-router-outlet>
</ion-split-pane>
</ion-app>
however this fails to compile, should we leave the warnings as they are now? Ionic info:
insert the output from ionic info here
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Fixing [ion-menu] and [ion-split-pane] deprecation warnings in ...
So, after a few trial and error changes I was able to clear the deprecation warnings with a few small edits in app.component.html....
Read more >Blank page with Vue.js and Ionic side menu - Stack Overflow
I got a blank page with a warning. ion-split-pane-ios.entry.js?f0b4:45 [DEPRECATED][ion-split-pane] Using the [main] attribute is deprecated ...
Read more >Unable to Build Production App for Ionic App
I am trying to build android app but getting error. Below is the log, could anyone please check and let me know what...
Read more >Ionic Forum - Latest posts - RSSing.com
I have an IonSplitPane that contains a menu and its pane. ... [capacitor] Use '--warning-mode all' to show the individual deprecation warnings.
Read more >@ionic/core | Yarn - Package Manager
2 before updating to version 6.0.0 in order to see deprecation warnings related to your app in the developer console. Please see the...
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 FreeTop 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
Top GitHub Comments
Your code should be:
The
div
in the warning refers to your main content (we didn’t want to useion-router-outlet
since vanilla Ionic apps do not use that).contentId
needs to be “my-content” which is the ID for the router outlet.