Fit map to feature layer bounds in react-leaflet
What I want to achieve: Have a <Map><FeatureGroup><Circle />[1 or more]...</FeatureGroup></Map> hierarchy and fit the map bounds to the feature group so that all the circles are in the viewport. If there is only one circle, it should fit the bounds (ie: zoom in on) to that circle. What I've tried: giving FeatureGroup a ref and calling getBounds on it to pass onto Map . Because of the lifecycle FeatureGroup doesn't exist at the time componentDidMount is called - it gets rendered later ( https://github.com/PaulLeCam/react-leaflet/issues/106#issuecomment-161594328 ). Storing Circle in state and