Skip to content

Commit 5eabcca

Browse files
add render results to instance so that we can access later
1 parent 6d00dd2 commit 5eabcca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inst/www/react-tools/react-tools.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ window.reactR = (function () {
8181
type: type,
8282
factory: function (el, width, height) {
8383
var lastValue,
84+
instance = null,
8485
renderValue = (function (value) {
8586
if (actualOptions.renderOnResize) {
8687
// value.tag might be a primitive string, in which
@@ -91,9 +92,10 @@ window.reactR = (function () {
9192
}
9293
lastValue = value;
9394
}
94-
ReactDOM.render(hydrate(components, value.tag), el);
95+
this.instance = ReactDOM.render(hydrate(components, value.tag), el);
9596
});
9697
return {
98+
instance: instance,
9799
renderValue: renderValue,
98100
resize: function (newWidth, newHeight) {
99101
if (actualOptions.renderOnResize) {
@@ -117,4 +119,4 @@ window.reactR = (function () {
117119
isTag: isTag
118120
}
119121
};
120-
})()
122+
})()

0 commit comments

Comments
 (0)