@@ -188,7 +191,7 @@ class Main extends ImmutableComponent {
{
sortedFrames.map(frame =>
this.frames[frame.get('key')] = node}
frames={this.props.windowState.get('frames')}
frame={frame}
key={frame.get('key')}
diff --git a/js/components/tab.js b/js/components/tab.js
index 00f94598e40..c8475dd9bf7 100644
--- a/js/components/tab.js
+++ b/js/components/tab.js
@@ -3,7 +3,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const React = require('react')
-const ReactDOM = require('react-dom')
const ImmutableComponent = require('./immutableComponent')
@@ -63,7 +62,7 @@ class Tab extends ImmutableComponent {
return
}
- const rect = ReactDOM.findDOMNode(this.refs.tab).getBoundingClientRect()
+ const rect = this.tab.getBoundingClientRect()
if (e.clientX > rect.left && e.clientX < rect.left + rect.width / 2 &&
!this.props.frameProps.get('tabIsDraggingOverLeftHalf')) {
WindowActions.tabDragDraggingOverLeftHalf(this.props.frameProps)
@@ -187,7 +186,7 @@ class Tab extends ImmutableComponent {
this.props.frameProps.get('tabIsDraggingOverRightHalf')
})}
data-frame-key={this.props.frameProps.get('key')}
- ref='tab'
+ ref={node => this.tab = node}
draggable='true'
title={this.props.frameProps.get('title')}
onMouseEnter={this.onMouseEnter.bind(this)}
diff --git a/js/components/urlBar.js b/js/components/urlBar.js
index 430f6075953..e2d9580f4b6 100644
--- a/js/components/urlBar.js
+++ b/js/components/urlBar.js
@@ -3,7 +3,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const React = require('react')
-const ReactDOM = require('react-dom')
const urlParse = require('url').parse
const ImmutableComponent = require('./immutableComponent')
@@ -40,7 +39,7 @@ class UrlBar extends ImmutableComponent {
}
updateDOMInputFocus (focused) {
- const urlInput = ReactDOM.findDOMNode(this.refs.urlInput)
+ const urlInput = this.urlInput
if (focused) {
urlInput.focus()
} else {
@@ -50,8 +49,7 @@ class UrlBar extends ImmutableComponent {
updateDOMInputSelected (selected) {
if (selected) {
- const urlInput = ReactDOM.findDOMNode(this.refs.urlInput)
- urlInput.select()
+ this.urlInput.select()
}
}
@@ -67,7 +65,7 @@ class UrlBar extends ImmutableComponent {
// Whether the suggestions box is visible
get suggestionsShown () {
- return this.refs.urlBarSuggestions.shouldRender()
+ return this.urlBarSuggestions.shouldRender()
}
onKeyDown (e) {
@@ -79,10 +77,10 @@ class UrlBar extends ImmutableComponent {
this.restore()
WindowActions.setUrlBarSelected(true)
} else {
- const selectedIndex = this.refs.urlBarSuggestions.activeIndex
+ const selectedIndex = this.urlBarSuggestions.activeIndex
if (this.suggestionsShown && selectedIndex > 0) {
// load the selected suggestion
- this.refs.urlBarSuggestions.clickSelected()
+ this.urlBarSuggestions.clickSelected()
} else if (!isUrl(location)) {
// do search.
WindowActions.loadUrl(this.props.activeFrameProps, this.searchDetail.get('searchURL').replace('{searchTerms}', location))
@@ -96,13 +94,13 @@ class UrlBar extends ImmutableComponent {
break
case KeyCodes.UP:
if (this.suggestionsShown) {
- this.refs.urlBarSuggestions.previousSuggestion()
+ this.urlBarSuggestions.previousSuggestion()
e.preventDefault()
}
break
case KeyCodes.DOWN:
if (this.suggestionsShown) {
- this.refs.urlBarSuggestions.nextSuggestion()
+ this.urlBarSuggestions.nextSuggestion()
e.preventDefault()
}
break
@@ -235,11 +233,11 @@ class UrlBar extends ImmutableComponent {
})}
id='urlInput'
readOnly={this.props.titleMode}
- ref='urlInput'/>
+ ref={node => this.urlInput = node}/>
{ !this.props.titleMode
? {this.loadTime} : null }
this.urlBarSuggestions = node}
suggestions={this.props.urlbar.get('suggestions')}
sites={this.props.sites}
frames={this.props.frames}