Skip to content

Commit 346be9f

Browse files
committed
Make <App> a function
1 parent 3b7b2d9 commit 346be9f

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

src/components/App.js

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
import React, { Component } from 'react'
1+
import React from 'react'
2+
23
import logo from '../logo.svg'
34
import StarCount from './StarCount'
45
import TableOfContents from './TableOfContents'
56
import Section from './Section'
67

7-
class App extends Component {
8-
render() {
9-
return (
10-
<div className="App">
11-
<header className="App-header">
12-
<StarCount />
13-
<img src={logo} className="App-logo" alt="logo" />
14-
<h1 className="App-title">The GraphQL Guide</h1>
15-
</header>
16-
<TableOfContents />
17-
<Section />
18-
</div>
19-
)
20-
}
21-
}
22-
23-
export default App
8+
export default () => (
9+
<div className="App">
10+
<header className="App-header">
11+
<StarCount />
12+
<img src={logo} className="App-logo" alt="logo" />
13+
<h1 className="App-title">The GraphQL Guide</h1>
14+
</header>
15+
<TableOfContents />
16+
<Section />
17+
</div>
18+
)

src/components/Section.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export default () => {
1212
<h2>Subtitle</h2>
1313
</header>
1414
</div>
15-
<div className="Section-content">
16-
{loading ? <Skeleton count={7} /> : null}
17-
</div>
15+
<div className="Section-content">{loading && <Skeleton count={7} />}</div>
1816
</section>
1917
)
2018
}

0 commit comments

Comments
 (0)