componentDidMount(){ // check if product already existed to avoid unnecessary fetching if( !this.props.products ){ fetchNeeds( ProductDetail.needs, this.props ) return <div>Loading...</div> } }
componentDidMount(){ // check if product already existed to avoid unnecessary fetching if( !this.props.products ){ fetchNeeds( ProductDetail.needs, this.props ) return <div>Loading...</div> } }