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

Popular posts from this blog

javascript - Replicate keyboard event with html button -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Web audio api 5.1 surround example not working in firefox -