Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created October 7, 2017 03:50
Show Gist options
  • Save tkssharma/b2c38561ac44f0bb9623ac69ca8a1617 to your computer and use it in GitHub Desktop.
Save tkssharma/b2c38561ac44f0bb9623ac69ca8a1617 to your computer and use it in GitHub Desktop.
export default class BasicRouting extends Component {
render() {
return (
<div>
<h1>BasicRouting</h1>
<div className="leftNavi">
<ul>
<li><Link to={this.props.match.url +"/level1"} className="active">Level 1</Link></li>
<li><Link to={this.props.match.url + "/level2"} className="active">Level 2</Link></li>
</ul>
</div>
<div className="rightContent">
<p>Second Level Content will appear here:</p>
<Route path={`${this.props.match.url}/:level`} component={Content}/>
</div>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment