-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
31 lines (29 loc) · 752 Bytes
/
App.js
File metadata and controls
31 lines (29 loc) · 752 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
import React, { useState } from "react"
import HexGrids, { HexGridItem, HexGridList } from "react-hex-grids"
function App() {
const [defaultUsage, setDefaultUsage] = useState(false)
return (
<>
<button
onClick={() => {
setDefaultUsage((value) => !value)
}}
>
toggle
</button>
{defaultUsage ? (
<HexGrids items={[1, 2, 3, 4, 5, 6, 7, 8, 9]} />
) : (
<HexGridList>
<HexGridItem>1</HexGridItem>
<HexGridItem>2</HexGridItem>
<HexGridItem>3</HexGridItem>
<HexGridItem>4</HexGridItem>
<HexGridItem>5</HexGridItem>
<HexGridItem>6</HexGridItem>
</HexGridList>
)}
</>
)
}
export default App