Skip to content

Commit 9f097a7

Browse files
authored
fix(lib/Canvas): fix onload not triggerd (#4)
Fix the issue where `onLoad` and `onLoadEnd` were not triggered after the view was loaded. This happens because `url` is `about://(null)` in iOS when using `html` in source like this: `source={{ html }}`. Setting the `baseUrl` parameter on the prop fixes the issue. For reference : facebook/react-native#18802 (comment) #2
1 parent 5cc082b commit 9f097a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Canvas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var Canvas = createReactClass({
6666
automaticallyAdjustContentInsets={false}
6767
scalesPageToFit={Platform.OS === 'android'}
6868
contentInset={{top: 0, right: 0, bottom: 0, left: 0}}
69-
source={{ html: getRenderHTML(contextString, renderString, generate) }}
69+
source={{ html: getRenderHTML(contextString, renderString, generate), baseUrl: '' }}
7070
opaque={false}
7171
underlayColor={'transparent'}
7272
style={this.props.style}

0 commit comments

Comments
 (0)