reactjs - React: Prop Not Displayed in React Component -
i passing prop in react route component listed below:
<route exact path='/' component={homepage} display_notification={this.display_notification.bind(this)} />
but when print props of homepage cannot find display_notification.
please help.
i using react-router-v4
route not recompose props you, passes internal location related props only. need use render={}
api - https://reacttraining.com/react-router/web/api/route/render-func
so like
<route exact path='/' render={() => <homepage display_notification={this.display_notification} />} />
Comments
Post a Comment