-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the whole leaflet ecosystem #1258
Conversation
@@ -18,7 +18,7 @@ const MapContainer: React.FC<Props> = ({ children, whenCreated, hasZoomControl = | |||
center={mapConfig.searchMapCenter as [number, number]} | |||
zoom={mapConfig.searchMapZoom} | |||
maxZoom={mapConfig.maximumZoomLevel} | |||
whenCreated={whenCreated} | |||
ref={whenCreated} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it kinda weird having a function as ref
props?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, since Leaflet 1.9 (I'm not sure of the version), the whenCreated
prop has been replaced by whenReady
but it's not really the same callback function.
When React-leaflet shipped version 4, the release note explicitly wrote:
Removed
whenCreated
property from theMapContainer
component (aref
callback can be used instead).
import MapContainer from 'components/Map/SearchMap/MapContainer'; | ||
import MoveHandler from 'components/Map/SearchMap/MoveHandler'; | ||
import SearchMapChildrens from 'components/Map/SearchMap/SearchMapChildrens'; | ||
import { ArrowLeft } from 'components/Icons/ArrowLeft'; | ||
import { useTileLayer } from 'hooks/useTileLayer'; | ||
import { BackButton } from '../components/BackButton'; | ||
import { FilterButton } from '../components/FilterButton'; | ||
import { ResetView } from '../components/ResetView'; | ||
import TileLayerManager from '../components/TileLayerManager'; | ||
import FullscreenControl from '../components/FullScreenControl'; | ||
import LocateControl from '../components/LocateControl'; | ||
import { BackButton } from 'components/Map/components/BackButton'; | ||
import { FilterButton } from 'components/Map/components/FilterButton'; | ||
import { ResetView } from 'components/Map/components/ResetView'; | ||
import TileLayerManager from 'components/Map/components/TileLayerManager'; | ||
import FullscreenControl from 'components/Map/components/FullScreenControl'; | ||
import LocateControl from 'components/Map/components/LocateControl'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching from relative paths to aliased path do not seams directly related to "Leaflet ecosystem".
Maybe should it have been done in a another dedicated PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes maybe 👀 😅
ref #1219