April
0
Q:

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>
0

Tags

Related

New to Communities?

Join the community