Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix default color and stroke width properties for Geojson component (#…
…3972) - Fixes #3971 - According to React docs, `defaultProps` only takes effect for `undefined` props, **not** `null` props - By returning `null` from `getColor`, it ends up passing a `null` prop down to the native component instead of the `defaultProps` values from `MapPolygon`, `MapPolyline`, etc. - Switching to a simple `return` will return `undefined` from `getColor` and `getStrokeWidth`, which means the default props can take effect - Updated the documentation to: - Specify the actual GeoJSON property names that are being checked - Specify that stroke color and stroke width are only used for polygons and polylines (not just "paths") - Specify that `fillColor` is only relevant for polygons - Add the undocumented `color` property, which appears to be used for Marker/"point" types - With these changes, the default stroke width of 1 and color of #000 seems to be working for my GeoJSON LineString/Polyline
- Loading branch information