Ниже приведен код проекта:
Codesandbox: https://codesandbox.io/p/sandbox/leafle ... c%2FApp.js
Demo.js
Код: Выделить всё
import * as React from "react";
import Button from "@mui/material/Button";
import LeafletMarker from "./LeafletMarker";
import { Marker, Popup, MapContainer, TileLayer } from "react-leaflet";
import ReactDOMServer from "react-dom/server";
import "leaflet/dist/leaflet.css";
import Box from "@mui/material/Box";
import L from "leaflet";
export default function Demo() {
return (
);
}
Код: Выделить всё
import Box from "@mui/material/Box";
import { createSvgIcon } from "@mui/material/utils";
const HomeIcon = createSvgIcon(
,
"Home"
);
function LeafletMarker({ bgcolor }) {
return (
);
}
export default LeafletMarker;
EDIT:
Исправлен пример кода, поскольку он не включал исходную опору цвета фона sx, которая демонстрирует проблему.>
Подробнее здесь: https://stackoverflow.com/questions/778 ... not-styled
Мобильная версия