I would like to ask a general question.
I have a menuContent.js
which is something like that.
class MenuContent extends Component {
constructor(props) {
super(props)
this.items = [];
// for (let i=1; i<=10; i++) {
// // this.items.push(i)
// }
}
render() {
return (
<div className="menu">
<a
href="/animation/animation"
onClick={this.props.closeCallback}
>
<img src={animation} alt="good as"/>
animation
</a>
<br />
<br />
)
}
}
and also a file which is called routing.js, which is something like that
class routing extends Component {
constructor(props) {
super(props)
this.items = [];
// for (let i=1; i<=10; i++) {
// // this.items.push(i)
// }
}
render() {
return (
<HashRouter>
<div className="menu">
<ul className="header">
<li><NavLink to="/animation/animation">Animation</NavLink></li>
<li><NavLink to="/bars/bars">Bars</NavLink></li>
</ul>
<div className="content">
<Route exact path="/" component={Home}/>
<Route path="/animation/animation" component={Animation}/>
<Route path="/bars/bars" component={Bars}/>
</div>
but i don't know how to call the routing.js into the menucontent file except for <routing />
into a the menucontent class