Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Commit 2ca3050

Browse files
committed
findDOMNode as a replacement for getDOMNode
1 parent 06e3db5 commit 2ca3050

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

01 - Core/06 - Refs.js

+19
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,22 @@ class Foo {
9797

9898
}
9999

100+
// Getting your "own" DOM node is still possible with a call to traverse the
101+
// composites until you get to the DOM node.
102+
103+
class Foo {
104+
105+
handleTick() {
106+
var node = React.findDOMNode(this);
107+
this.setState({ width: node.offsetWidth });
108+
}
109+
110+
render() {
111+
return (
112+
<C tick={this.handleTick}>
113+
<div />
114+
</C>
115+
);
116+
}
117+
118+
}

0 commit comments

Comments
 (0)