Skip to content

Commit f74ee7a

Browse files
fix(js): messagingEnabled prop (#2666)
This was always being set to "true", even if no onMessage handler was provided
1 parent 4c05077 commit f74ee7a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/WebView.android.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const WebViewComponent = forwardRef<{}, AndroidWebViewProps>(({
164164
const webView = <NativeWebView
165165
key="webViewKey"
166166
{...otherProps}
167-
messagingEnabled={typeof onMessage === 'function'}
167+
messagingEnabled={typeof onMessageProp === 'function'}
168168
messagingModuleName={messagingModuleName}
169169

170170
onLoadingError={onLoadingError}

src/WebView.ios.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps>(({
174174
useSharedProcessPool={useSharedProcessPool}
175175
textInteractionEnabled={textInteractionEnabled}
176176
decelerationRate={decelerationRate}
177-
messagingEnabled={typeof onMessage === 'function'}
177+
messagingEnabled={typeof onMessageProp === 'function'}
178178
onLoadingError={onLoadingError}
179179
onLoadingFinish={onLoadingFinish}
180180
onLoadingProgress={onLoadingProgress}

src/WebView.macos.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const WebViewComponent = forwardRef<{}, MacOSWebViewProps>(({
149149
javaScriptEnabled={javaScriptEnabled}
150150
cacheEnabled={cacheEnabled}
151151
useSharedProcessPool={useSharedProcessPool}
152-
messagingEnabled={typeof onMessage === 'function'}
152+
messagingEnabled={typeof onMessageProp === 'function'}
153153
onLoadingError={onLoadingError}
154154
onLoadingFinish={onLoadingFinish}
155155
onLoadingProgress={onLoadingProgress}

src/WebView.windows.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const WebViewComponent = forwardRef<{}, WindowsWebViewProps>(({
126126
const webView = <NativeWebView
127127
key="webViewKey"
128128
{...otherProps}
129-
messagingEnabled={typeof onMessage === 'function'}
129+
messagingEnabled={typeof onMessageProp === 'function'}
130130
onLoadingError={onLoadingError}
131131
onLoadingFinish={onLoadingFinish}
132132
onLoadingProgress={onLoadingProgress}

0 commit comments

Comments
 (0)