-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathApp.js
More file actions
36 lines (29 loc) · 781 Bytes
/
App.js
File metadata and controls
36 lines (29 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React, { Component } from 'react';
import data from './Components/data';
import './App.css';
import NavWrapper from './Components/NavWrapper';
import SubNav from './Components/SubNav';
import {Route} from "react-router-dom";
class App extends Component {
constructor(){
super();
this.state = {
linkData: data
}
}
// componentDidMount() {
// this.setState({
// linkData: data
// })
// }
render() {
return (
<div className="App">
<Route path="/" render={props => <NavWrapper {...props} linkData={this.state.linkData} />}/>
<Route path="/products/:id"
render={props => <SubNav {...props} subNavData={this.state.linkData}/>} />
</div>
);
}
}
export default App;