I have created workplace 10 components and trying to get data from the workplace1 component using the side menu component.
In the side menu, I have created workplace 10 components if click workplace10th li component loading workplace component 10 but I cannot see which component had selected in the side menu
...please refer my code in this link https://codesandbox.io/s/fervent-http-ijbiz
this is workplaces component
class WorkPlace1 extends Component {
render() {
return (
<div>
<div>
<Row>
<Col sm={4}>
<Worksplaces />
</Col>
<Col sm={5}>
<div>Work Place 1</div>
</Col>
</Row>
</div>
</div>
);
}
}
this is workplace2 component
class WorkPlace2 extends Component {
render() {
return (
<div>
<div>
<Row>
<Col sm={4}>
<Worksplaces />
</Col>
<Col sm={5}>
<div>Work Place 2</div>
</Col>
</Row>
</div>
</div>
);
}
}
this is side menu component
class Home extends Component {
render() {
return (
<div>
<ul className="side-menu-ul-data">
<NavLink exact to="/workplaces/workplace1">
<li>Work Place 1</li>
</NavLink>
<NavLink exact to="/workplaces/workplace2">
<li>Work Place 2</li>
</NavLink>
<NavLink exact to="/workplaces/workplace3">
<li>Work Place 3</li>
</NavLink>
<NavLink exact to="/workplaces/workplace4">
<li>Work Place 4</li>
</NavLink>
<NavLink exact to="/workplaces/workplace5">
<li>Work Place 5</li>
</NavLink>
<NavLink exact to="/workplaces/workplace6">
<li>Work Place 6</li>
</NavLink>
<NavLink exact to="/workplaces/workplace7">
<li>Work Place 7</li>
</NavLink>
<NavLink exact to="/workplaces/workplace8">
<li>Work Place 8</li>
</NavLink>
<NavLink exact to="/workplaces/workplace9">
<li>Work Place 9</li>
</NavLink>
<NavLink exact to="/workplaces/workplace10">
<li>Work Place 10</li>
</NavLink>
</ul>
</div>
);
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…