export default class Root extends React.Component{
constructor(props) {
super(props);
}
dealsCallBack = (dealListFromHome)=>{
console.log("deals from home"+dealListFromHome);
}
render(){
return(
<div>
<Header/>
<Switch>
<Route exact path="/" component={Home}/>
<Route exact path="/mall/:id" component={MallDetail}/>
<Route path="/home/:location" render={(props) => (<Home passDealsToRoute ={this.dealsCallBack} {...props}/>)} />
<Route exact path="/about" component={About}/>
</Switch>
<Footer/>
</div>
);
}
}
How do I access the passDealsToRoute from the component Home? this.props. passDealsToRoute(theList) is not working.