Skip to content

Commit a0147af

Browse files
Apply suggestions from code review
Co-authored-by: Xiaoji Chen <Pessimistress@users.noreply.github.com>
1 parent aafcb4a commit a0147af

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

examples/get-started/hook/controls.jsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,20 @@ export default function Controls() {
77
/**
88
* ## This is how `useMap` works:
99
* ```
10-
* const demo = useMap();
11-
* console.log('Controls', {demo});
10+
* const maps = useMap();
11+
* console.log('Controls useMap()', maps);
1212
* ```
1313
* ### First render:
1414
* ```
1515
* {
16-
* "demo": {
17-
* "current": undefined
18-
* }
16+
* "current": undefined
1917
* }
2018
* ```
2119
* ### Second render:
2220
* ```
2321
* {
24-
* "demo": {
2522
* "current": undefined,
2623
* "mymap": {...} // See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
27-
* }
2824
* }
2925
* ```
3026
*/

examples/get-started/hook/controls2.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ export default function Controls2() {
88
* See https://visgl.github.io/react-map-gl/docs/api-reference/use-map
99
* See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
1010
* ```
11-
* const demo = useMap();
12-
* console.log('Controls2', {demo});
11+
* const maps = useMap();
12+
* console.log('Controls2 useMap()', maps);
1313
* ```
1414
* ### First render:
1515
* ```
1616
* {
17-
* "demo": {
18-
* "current": {...},
19-
* "mymap": {...}
20-
* }
17+
* "current": {...}, // this is the same as `mymap`
18+
* "mymap": {...}
2119
* }
2220
* ```
2321
*/

examples/get-started/hook/map.jsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,18 @@ export default function MapView() {
1010
/**
1111
* ## This is how `useMap` works:
1212
* ```
13-
* const demo = useMap();
14-
* console.log('MapView', {demo});
13+
* const maps = useMap();
14+
* console.log('MapView useMap()', maps);
1515
* ```
1616
* ### First render:
1717
* ```
1818
* {
19-
* "demo": {
20-
* "current": undefined
21-
* }
19+
* "current": undefined
2220
* }
2321
* Second render:
2422
* {
25-
* "demo": {
26-
* "current": undefined,
27-
* "mymap": {...} // See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
28-
* }
23+
* "current": undefined,
24+
* "mymap": {...} // See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
2925
* }
3026
* ```
3127
*/

0 commit comments

Comments
 (0)