Skip to content

Commit 102e96b

Browse files
committed
LeafletView/index: forward styles to webview
This is necessary in order to fix a crash with react-navigation we ran into with a newer `react-native` version. See: react-native-webview/react-native-webview#1915 (comment)
1 parent d2cb044 commit 102e96b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/LeafletView/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useCallback, useEffect, useRef, useState } from 'react';
2-
import { WebView } from 'react-native-webview';
2+
import { WebView, WebViewProps } from 'react-native-webview';
33
import {
44
MapMarker,
55
WebviewLeafletMessage,
@@ -49,6 +49,7 @@ export type LeafletViewProps = {
4949
zoom?: number;
5050
doDebug?: boolean;
5151
androidHardwareAccelerationDisabled?: boolean;
52+
webviewStyle?: WebViewProps;
5253
};
5354

5455
const LeafletView: React.FC<LeafletViewProps> = ({
@@ -65,6 +66,7 @@ const LeafletView: React.FC<LeafletViewProps> = ({
6566
zoom,
6667
doDebug,
6768
androidHardwareAccelerationDisabled,
69+
webviewStyle,
6870
}) => {
6971
const webViewRef = useRef<WebView>(null);
7072
const [initialized, setInitialized] = useState(false);
@@ -218,6 +220,7 @@ const LeafletView: React.FC<LeafletViewProps> = ({
218220
allowUniversalAccessFromFileURLs={true}
219221
allowFileAccessFromFileURLs={true}
220222
androidHardwareAccelerationDisabled={androidHardwareAccelerationDisabled}
223+
style={webviewStyle}
221224
/>
222225
);
223226
};

0 commit comments

Comments
 (0)