important filter code example
Example: 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>