score:0

you should calculate the progress inside of the render function and you should do that based on the object from this.props.userdetails directly, instead of assigning it to the this.therapist property.

render = () => {
    // ...
    const therapist = this.props.userdetails;
    let progress = 0;

    if (therapist.phone) progress += 16;
    // ...

    return (
        <div>
            { progress }
        </div>
    );
}

Related Query

More Query from same tag