I have been trying to solve in passing a variable value from a main component (App.js)
to a child component Attendees.js
. The route is as follows
App.js
<Router>
...
<Route path="/attendees/:userID/:meetingID" component={Attendees}
adminUser={this.state.userId}/>} />
</Router>
Attendees.js
componentDidMount(){
const meetingID = this.props.match.params.meetingID
const adminUser = this.props.adminUser
}
I am not able to retrieve the adminUser which passed as props.(adminUser is getting undefined). But I am able to do variables (meetingID, userID)
encoded in URL.
How can I get the value adminUser
in child component.