I am trying to pass props to the UpdatePassword component in React using Router, Link, which rendered UpdatePassword component . I am surprised, the link were working before but after some changes on server side, now when i click on it, nothing happens. Also if i display the page by adding url manually, the component is rendered but data sent is undefined. Kindly suggest what I can do here?
I have imported these in Dashboard component
import {BrowserRouter as Router,withRouter,Link,Switch,Route} from 'react-router-dom'
and this is my return statement in same component
return <>
<Header/>
<div id="wrapper">
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<Router>
<li> <Link to ={{pathname :"/updatePassword", state :this.state}}>Update Password</Link> </li>
<li> <Link to ={{pathname :"/updateUserInfo", state :this.state}}>Update User Details</Link> </li>
</Router>
</ul>
</div>
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1>Welcome {str2}</h1>
<a href="#menu-toggle" class="btn btn-default" id="menu-toggle">Toggle Menu</a>
<Router>
<Route path='/updatePassword' component ={UpdatePassword}/>
</Router>
</div>
</div>
</div>
</div>
</div>
</>;
In my UpdatePassword component, props has state undefined.