I have the following code and I want to access the idOperand in the getRelationalOperators function but it is undefined
How can I access idOperand?
class sample extends Component {
constructor (props) {
super()
this.state = {
idOperand: {},
}
this.getRelationalOperators = this.getRelationalOperators.bind(this);
}
componentDidMount(){
this.getRelationalOperators();
}
componentDidUpdate(prevProps) {
if (prevProps.observationDetail !== this.props.observationDetail ) {
this.setState({
idOperand: this.props.observationDetail,
})
}
getRelationalOperators() {
var command = this.state.idOperand.Operand;
GetRestrictionListService.getRelationalOperators(command, this.successRelationalOperators)
}