I have an array that contains a string. I'm trying to take that string and join it with another string. When I console.log('Dates: ' + mergedActions) I get back both strings together. However when I console.log('Dates: ' + this.state.MergedAllActions) it's empty. I tried adding a timeout to the console log but still nothing.
Any idea why mergedActions even though it contains information doesn't get set in MergedAllActions?
let currentAction = 'Form has been submitted';
let mergedActions = this.state.Product[0].AllActions + ',' + currentAction;
this.setState({ MergedAllActions: mergedActions });
console.log('Dates: ' + mergedActions);
console.log('Dates: ' + this.state.MergedAllActions);
Console below:
Dates: first Step,First Approver accepted
Dates: