Skip to content

Commit 36c7c36

Browse files
committed
create copy of read only object
1 parent 2d156eb commit 36c7c36

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

WKWebView.ios.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,11 @@ class WKWebView extends React.Component {
312312
WKWebViewManager.startLoadWithResult(!!shouldStart, event.nativeEvent.lockIdentifier);
313313
});
314314

315-
let source = this.props.source || {};
316-
if (typeof source == 'object') {
317-
source.sendCookies = this.props.sendCookies;
318-
source.customUserAgent =
319-
this.props.customUserAgent || this.props.userAgent;
320-
source.useWKCookieStore = this.props.useWKCookieStore;
321-
}
315+
let source = Object.assign({}, this.props.source || {}, {
316+
sendCookies: this.props.sendCookies,
317+
customUserAgent: this.props.customUserAgent || this.props.userAgent,
318+
useWKCookieStore: this.props.useWKCookieStore,
319+
});
322320

323321
if (this.props.html) {
324322
source.html = this.props.html;

0 commit comments

Comments
 (0)