Constant is undefined when equal to this.state in React, causing findindex to blow up cannot read properties of undefined

const {activitiesResult} = this.state;  //activitiesResult 

shows as undefined in debug.

    const {authHeader} = this.props;
    const activityIndex = activitiesResult.findIndex((obj) => obj.publicID === data);

This line of code of course blows up I need to use several property in this object later.

Can someone explain why the const is undefined? That the is error in debugging, as that is the error I am getting. How to get around this? I am new to react.

I have tried to put it in an array. I have tried setState, but I am new to react. When I debug I can see the properties in this.state. They are not getting assigned to the constant. It shows as undefined.