We have a table of users in a workflow where each user has a different status based on which step they are in the workflow. For ease of the example, lets say there are 4 steps from 1-4.
Each user has a button on their table row that when clicked, opens up a modal that grabs their userId and current step as data values.
handleClick = (event) => {
let step = event.target.dataset.step;
let id = event.target.dataset.id;
this.setState({ currentStep: step, userId: id, moveUserModal: true });
}
.........
<Modal
isOpen={this.state.moveUserModal}
>
<UserModal step={this.state.currentStep} userId={this.state.userId} close={this.close} />
</Modal>
And in the modal:
constructor(props) {
super(props);
console.log(this.props);
}
the console log returns undefined for the two vars and f() for close. If moveUserModal is true, is there a reason that the other vars wouldnt already have a value the constructor can access?
console.login therender()method of the modal. Constructor is not called when parent re-rendershandleClickto confirm that the values are being set correct?