Skip to content

Commit 5f26324

Browse files
committed
Bring back changes from #18 'add render results to instance' that were lost
1 parent a3dbcd2 commit 5f26324

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

srcjs/widget.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export function reactWidget(name, type, components, options) {
8080
type: type,
8181
factory: function (el, width, height) {
8282
var lastValue,
83+
instance = {},
8384
renderValue = (function (value) {
8485
if (actualOptions.renderOnResize) {
8586
// value.tag might be a primitive string, in which
@@ -90,9 +91,10 @@ export function reactWidget(name, type, components, options) {
9091
}
9192
lastValue = value;
9293
}
93-
ReactDOM.render(hydrate(components, value.tag), el);
94+
this.instance.component = ReactDOM.render(hydrate(components, value.tag), el);
9495
});
9596
return {
97+
instance: instance,
9698
renderValue: renderValue,
9799
resize: function (newWidth, newHeight) {
98100
if (actualOptions.renderOnResize) {

0 commit comments

Comments
 (0)