Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Xiaoji Chen <Pessimistress@users.noreply.github.com>
  • Loading branch information
tordans and Pessimistress committed Jul 6, 2024
1 parent c177528 commit 9fc4fcb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
10 changes: 3 additions & 7 deletions examples/get-started/hook/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,20 @@ export default function Controls() {
/**
* ## This is how `useMap` works:
* ```
* const demo = useMap();
* console.log('Controls', {demo});
* const maps = useMap();
* console.log('Controls useMap()', maps);
* ```
* ### First render:
* ```
* {
* "demo": {
* "current": undefined
* }
* "current": undefined
* }
* ```
* ### Second render:
* ```
* {
* "demo": {
* "current": undefined,
* "mymap": {...} // See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
* }
* }
* ```
*/
Expand Down
10 changes: 4 additions & 6 deletions examples/get-started/hook/controls2.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ export default function Controls2() {
* See https://visgl.github.io/react-map-gl/docs/api-reference/use-map
* See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
* ```
* const demo = useMap();
* console.log('Controls2', {demo});
* const maps = useMap();
* console.log('Controls2 useMap()', maps);
* ```
* ### First render:
* ```
* {
* "demo": {
* "current": {...},
* "mymap": {...}
* }
* "current": {...}, // this is the same as `mymap`
* "mymap": {...}
* }
* ```
*/
Expand Down
14 changes: 5 additions & 9 deletions examples/get-started/hook/map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,18 @@ export default function MapView() {
/**
* ## This is how `useMap` works:
* ```
* const demo = useMap();
* console.log('MapView', {demo});
* const maps = useMap();
* console.log('MapView useMap()', maps);
* ```
* ### First render:
* ```
* {
* "demo": {
* "current": undefined
* }
* "current": undefined
* }
* Second render:
* {
* "demo": {
* "current": undefined,
* "mymap": {...} // See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
* }
* "current": undefined,
* "mymap": {...} // See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
* }
* ```
*/
Expand Down

0 comments on commit 9fc4fcb

Please sign in to comment.