-
Notifications
You must be signed in to change notification settings - Fork 24
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
The contents of <Control> do not get rendered on initial <Map> display. #27
Comments
Faced with this issue too. Do you have any suggestions how to fix it without using forceUpdate? |
I have no idea. |
This happens because:
This is just an external observation of the problem though. Not sure why this happens or what to do next. |
A temp solution until this is fixed is to do a
|
A dumb fix would be for |
How about that: https://codesandbox.io/s/pj5k2v8l9x?module=%2Fsrc%2FControl.js |
I have run into the same problem. As I am using function components and react hooks there is no So in order to force an update on component mount I set state like this:
where |
As recommended here: LiveBy/react-leaflet-control#27 (comment)
As recommended here: LiveBy/react-leaflet-control#27 (comment)
As recommended here: LiveBy/react-leaflet-control#27 (comment)
I've updated my reproduce link https://codesandbox.io/s/n4y9opn000 with the latest dependencies including |
I think there might have been a packaging issue. https://unpkg.com/react-leaflet-control@2.1.0/dist/control.js does not contain |
This problem occurs again on v2.1.2, which contains |
When using this code:
The initial
<Map>
render results in the following HTML which doesn't really contain the contents of the custom control, just its wrapper:As soon as the next
<Map>
render takes place, the custom control HTMLs is finalized to:Live example: https://codesandbox.io/s/n4y9opn000
The text was updated successfully, but these errors were encountered: