componentWillReceiveProps(nextProps) {
        this.setState({
            id: nextProps.id,
            title: nextProps.postTitle,
            description: nextProps.postDescription,
            date: nextProps.postDate,
            image:nextProps.postImage
        });
    }
// Used to initialize the component with the previous state
Used to initialize the component with the previous state
Used to initialize the component with the previous state
componentWillReceiveProps(nextProps) {
        this.setState({
            id: nextProps.id,
            title: nextProps.postTitle,
            description: nextProps.postDescription,
            date: nextProps.postDate,
            image:nextProps.postImage
        });
    }
componentWillReceiveProps ( nextProps ) { this . setState ( { id : nextProps . id , title : nextProps . postTitle , description : nextProps . postDescription , date : nextProps . postDate , image : nextProps . postImage } ) ; }
Used to initialize the component with the previous state
Used to initialize the component with the previous state