Reactjs – Setting State from props using setState in child component

componentWillMount is called only once in the component lifecycle, immediately before the component is rendered. It is usually used to perform any state changes needed before the initial render, because calling this.setState in this method will not trigger an additional render
So you can update your staate using

componentWillMount ()
{

        this.setState({ members : props.members });


}

Leave a Comment