TL;DR
Is there way to debug the NavigationMixin
? My Button
fires the navigation method and nothing happens.
Hello, I'm not sure what's going wrong here. My understanding is that this setup should be sufficient. When I console log a message, I can determine that my button is activating, but the NavigationMixin is not firing the new page. The page is just a a page with a default Rich Content element that says "Thank You" there is no additional logic on that page.
HTML
<template>
<lightning-button label="My Button" onclick={navigateToInternalPage}></lightning-button>
</template>
JAVASCRIPT
import { LightningElement, api, wire, track } from 'lwc';
import getUserData from '@salesforce/apex/CommunitiesData.getUserData';
import { getFieldValue } from 'lightning/uiRecordApi';
import ID from '@salesforce/user/Id';
import FIRST_NAME from '@salesforce/schema/User.FirstName';
import EMAIL from '@salesforce/schema/User.Email';
import communityBasePath from '@salesforce/community/basePath';
import {NavigationMixin} from "lightning/navigation";
export default class UniversalIntakeForm extends NavigationMixin(LightningElement) {
@track error;
@track email;
@api recordId = ID;
email = EMAIL;
firstName = FIRST_NAME;
user;
navigateToInternalPage() {
// Use the basePath from the Summer '20 module to construct the URL
this[NavigationMixin.Navigate]({
type: 'comm__namedPage',
attributes: {
pageName: 'testPage__c'
}
});
}