Skip to content

Commit

Permalink
Merge pull request react-bootstrap#704 from vasanthk/master
Browse files Browse the repository at this point in the history
getDOMNode() has been deprecated. Use React.findDOMNode() instead.
  • Loading branch information
dozoisch committed May 19, 2015
2 parents 4c1968f + 2125d96 commit e4d0aff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/examples/CollapsibleParagraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const CollapsibleParagraph = React.createClass({
mixins: [CollapsibleMixin],

getCollapsibleDOMNode(){
return this.refs.panel.getDOMNode();
return React.findDOMNode(this.refs.panel);
},

getCollapsibleDimensionValue(){
return this.refs.panel.getDOMNode().scrollHeight;
return React.findDOMNode(this.refs.panel).scrollHeight;
},

onHandleToggle(e){
Expand Down
6 changes: 3 additions & 3 deletions docs/src/ComponentsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ const ComponentsPage = React.createClass({
},

componentDidMount() {
let elem = this.refs.sideNav.getDOMNode(),
let elem = React.findDOMNode(this.refs.sideNav),
domUtils = Affix.domUtils,
sideNavOffsetTop = domUtils.getOffset(elem).top,
sideNavMarginTop = parseInt(domUtils.getComputedStyles(elem.firstChild).marginTop, 10),
topNavHeight = this.refs.topNav.getDOMNode().offsetHeight;
topNavHeight = React.findDOMNode(this.refs.topNav).offsetHeight;

this.setState({
navOffsetTop: sideNavOffsetTop - topNavHeight - sideNavMarginTop,
navOffsetBottom: this.refs.footer.getDOMNode().offsetHeight
navOffsetBottom: React.findDOMNode(this.refs.footer).offsetHeight
});
},

Expand Down
6 changes: 3 additions & 3 deletions docs/src/ReactPlayground.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class CodeMirrorEditor extends React.Component {
return;
}

this.editor = CodeMirror.fromTextArea(this.refs.editor.getDOMNode(), {
this.editor = CodeMirror.fromTextArea(React.findDOMNode(this.refs.editor), {
mode: 'javascript',
lineNumbers: false,
lineWrapping: false,
Expand Down Expand Up @@ -273,7 +273,7 @@ const ReactPlayground = React.createClass({
},

componentWillUnmount() {
let mountNode = this.refs.mount.getDOMNode();
let mountNode = React.findDOMNode(this.refs.mount);
try {
React.unmountComponentAtNode(mountNode);
} catch (e) {
Expand All @@ -282,7 +282,7 @@ const ReactPlayground = React.createClass({
},

executeCode() {
let mountNode = this.refs.mount.getDOMNode();
let mountNode = React.findDOMNode(this.refs.mount);

try {
React.unmountComponentAtNode(mountNode);
Expand Down
4 changes: 2 additions & 2 deletions src/CollapsibleNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const specCollapsibleNav = {
},

getCollapsibleDOMNode() {
return this.getDOMNode();
return React.findDOMNode(this);
},

getCollapsibleDimensionValue() {
Expand All @@ -31,7 +31,7 @@ const specCollapsibleNav = {
for (let key in nodes) {
if (nodes.hasOwnProperty(key)) {

let n = nodes[key].getDOMNode()
let n = React.findDOMNode(nodes[key])
, h = n.offsetHeight
, computedStyles = domUtils.getComputedStyles(n);

Expand Down

0 comments on commit e4d0aff

Please sign in to comment.