Skip to content

Commit

Permalink
fix(menu): prerender
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Apr 6, 2018
1 parent c6e962c commit a3cd5db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class Menu {
@State() isRightSide = false;

@Prop({ context: 'config' }) config: Config;
@Prop({ context: 'isServer' }) isServer: boolean;
@Prop({ connect: 'ion-menu-controller' }) lazyMenuCtrl: HTMLIonMenuControllerElement;
@Prop({ context: 'enableListener' }) enableListener: EventListenerEnable;

Expand Down Expand Up @@ -128,10 +129,10 @@ export class Menu {
}

componentDidLoad() {
assert(!!this.menuCtrl, 'menucontroller was not initialized');

if (this.isServer) {
return;
}
const el = this.el;

const content = (this.contentId)
? document.getElementById(this.contentId)
: el.parentElement.querySelector('[main]');
Expand Down

0 comments on commit a3cd5db

Please sign in to comment.