Skip to content

Commit a577c81

Browse files
committed
Fixed default props error / warning
1 parent 5685e5e commit a577c81

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/LeafletView/index.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ export type LeafletViewProps = {
5252
};
5353

5454
const LeafletView: React.FC<LeafletViewProps> = ({
55-
renderLoading,
55+
renderLoading = (() => <LoadingIndicator />),
5656
onError,
5757
onLoadEnd,
5858
onLoadStart,
5959
onMessageReceived,
60-
mapLayers,
60+
mapLayers = DEFAULT_MAP_LAYERS,
6161
mapMarkers,
6262
mapShapes,
6363
mapCenterPosition,
6464
ownPositionMarker,
65-
zoom,
66-
doDebug,
65+
zoom = DEFAULT_ZOOM,
66+
doDebug = __DEV__,
6767
androidHardwareAccelerationDisabled,
6868
}) => {
6969
const webViewRef = useRef<WebView>(null);
@@ -223,13 +223,6 @@ const LeafletView: React.FC<LeafletViewProps> = ({
223223
);
224224
};
225225

226-
LeafletView.defaultProps = {
227-
renderLoading: () => <LoadingIndicator />,
228-
mapLayers: DEFAULT_MAP_LAYERS,
229-
zoom: DEFAULT_ZOOM,
230-
doDebug: __DEV__,
231-
};
232-
233226
const styles = StyleSheet.create({
234227
container: {
235228
flex: 1,

0 commit comments

Comments
 (0)