Skip to content

Commit 761fa5c

Browse files
committed
call onLoad given as Props
1 parent 19addf4 commit 761fa5c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Frame.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export class Frame extends Component {
1111
// element that we render react into.
1212
static propTypes = {
1313
style: PropTypes.object, // eslint-disable-line
14+
onLoad: PropTypes.func,
1415
head: PropTypes.node,
1516
initialContent: PropTypes.string,
1617
mountTarget: PropTypes.string,
@@ -24,6 +25,7 @@ export class Frame extends Component {
2425

2526
static defaultProps = {
2627
style: {},
28+
onLoad: undefined,
2729
head: null,
2830
children: undefined,
2931
mountTarget: undefined,
@@ -82,6 +84,9 @@ export class Frame extends Component {
8284

8385
handleLoad = () => {
8486
this.setState({ iframeLoaded: true });
87+
if (this.props.onLoad) {
88+
this.props.onLoad();
89+
}
8590
};
8691

8792
renderFrameContents() {

0 commit comments

Comments
 (0)