Skip to content

Commit e148613

Browse files
committed
Read/write refs on this
Fixes #123
1 parent b7b7a99 commit e148613

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/React.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exports.getProps = getProps;
1313

1414
function getRefs(this_) {
1515
return function(){
16-
return this_.refs;
16+
return this_;
1717
};
1818
}
1919
exports.getRefs = getRefs;
@@ -43,8 +43,7 @@ exports.getChildren = getChildren;
4343
function readRefImpl (this_) {
4444
return function(name) {
4545
return function() {
46-
var refs = this_.refs || {};
47-
return refs[name];
46+
return this_[name];
4847
}
4948
}
5049
}
@@ -54,9 +53,7 @@ function writeRef(this_) {
5453
return function(name) {
5554
return function(node) {
5655
return function() {
57-
var refs = this_.refs || {};
58-
refs[name] = node;
59-
this_.refs = refs;
56+
this_[name] = node;
6057
return {};
6158
}
6259
}

0 commit comments

Comments
 (0)