Answers for "important filter"

0

important filter

//1 component
removetour=id=>{
          const {tours}=this.state;
          const sortedtour=tours.filter(data=>data.id!==id );
          this.setState({
              tours:sortedtour,
          });
      }
      
      //second component
        <span onClick={()=>{removetour(id)}} className="close-btn">
                    <i class="fa fa-window-close"></i>
                </span>
Posted by: Guest on May-20-2020

Browse Popular Code Answers by Language