My Lightning Web Component operates as expected, data from the apex class is passed into the js class, and renders correctly in the lightning data table. However, in the @wire function, none of my console.logs show up as anything but undefined or an empty array. Debugging in chrome is the same thing, even as i step through the code all the variables are undefined. constantData was just a tester variable, this.data isnt defined either
import { LightningElement, track, wire} from 'lwc';
import getActiveMaterials from
'@salesforce/apex/pcMaterialsClass.getActiveMaterials';
const columns = [
removed these for space as they aren't pertinent to the question
]
export default class PcMaterials extends LightningElement {
@track aidata = [];
@track columns = columns;
@wire(getActiveMaterials)
wiredpcMaterials({error, data}) {
if(data) {
this.aidata = data;
let constantData = this.aidata;
// eslint-disable-next-line no-console
console.log(constantData);
} else if(error) {
this.error = error;
}
}
}