Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions MonorepoNX-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ nx run {package-name}:{task-name}
E.g. to start the dev environment of the react-maplibre project run:

```sh
nx run react-maplibre:dev
nx run react-maplibre:storybook
```

Alternatively, you can also use:
Expand All @@ -47,7 +47,13 @@ nx {task-name} {package-name}
To run all tasks in parallel, use:

```sh
nx run-many --target={task-name} --all
nx run-many -t {task-name}
```

E.g. to start all storybooks in dev mode run:

```sh
nx run-many -t storybook
```

## Add New Projects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ const MapLibreMap: MapLibreMapComponent = (props: MapLibreMapProps) => {

if (mapContainer.current) {
initializedRef.current = true;
if (props?.options?.style) {
currentStyle.current = JSON.stringify(props.options.style);
}
mapRef.current = new MapLibreGlWrapper({
mapOptions: {
style: '',
Expand Down Expand Up @@ -120,13 +123,12 @@ const MapLibreMap: MapLibreMapComponent = (props: MapLibreMapProps) => {
}, [props.options, props.mapId]);

useEffect(() => {
if (
mapRef.current?.map &&
props?.options?.style &&
currentStyle.current !== props.options.style
) {
currentStyle.current = props.options.style;
mapRef.current.map.setStyle(props.options.style);
if (mapRef.current?.map && props?.options?.style) {
const newStyleString = JSON.stringify(props.options.style);
if (currentStyle.current !== newStyleString) {
currentStyle.current = newStyleString;
mapRef.current.map.setStyle(props.options.style);
}
}
}, [props?.options?.style]);

Expand Down
Loading