Remove findDOMNode and rename all Navbar to NavBar
findDOMNode should be avaided <https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
var React = require('react');
|
var React = require('react');
|
||||||
|
|
||||||
var Navbar = React.createClass({
|
var NavBar = React.createClass({
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
||||||
@@ -86,4 +86,4 @@ var Navbar = React.createClass({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = Navbar;
|
module.exports = NavBar;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/* global chrome */
|
/* global chrome */
|
||||||
|
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
var ReactDOM = require('react-dom');
|
|
||||||
var ReactCSSTransitionGroup = require('react-addons-css-transition-group');
|
var ReactCSSTransitionGroup = require('react-addons-css-transition-group');
|
||||||
|
|
||||||
var config = require('../config');
|
var config = require('../config');
|
||||||
@@ -53,9 +52,9 @@ var Options = React.createClass({
|
|||||||
loggingStyle: items.loggingStyle
|
loggingStyle: items.loggingStyle
|
||||||
});
|
});
|
||||||
|
|
||||||
ReactDOM.findDOMNode(that.refs.theme).value = items.theme;
|
that.refs.theme.value = items.theme;
|
||||||
ReactDOM.findDOMNode(that.refs.loggingType).value = items.loggingType;
|
that.refs.loggingType.value = items.loggingType;
|
||||||
ReactDOM.findDOMNode(that.refs.loggingStyle).value = items.loggingStyle;
|
that.refs.loggingStyle.value = items.loggingStyle;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -68,9 +67,9 @@ var Options = React.createClass({
|
|||||||
saveSettings: function () {
|
saveSettings: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
var theme = ReactDOM.findDOMNode(this.refs.theme).value.trim();
|
var theme = this.refs.theme.value.trim();
|
||||||
var loggingType = ReactDOM.findDOMNode(this.refs.loggingType).value.trim();
|
var loggingType = this.refs.loggingType.value.trim();
|
||||||
var loggingStyle = ReactDOM.findDOMNode(this.refs.loggingStyle).value.trim();
|
var loggingStyle = this.refs.loggingStyle.value.trim();
|
||||||
// Trimming blacklist and whitelist removes blank lines and spaces.
|
// Trimming blacklist and whitelist removes blank lines and spaces.
|
||||||
var blacklist = that.state.blacklist.trim();
|
var blacklist = that.state.blacklist.trim();
|
||||||
var whitelist = that.state.whitelist.trim();
|
var whitelist = that.state.whitelist.trim();
|
||||||
@@ -96,7 +95,7 @@ var Options = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_displayBlackOrWhiteList: function () {
|
_displayBlackOrWhiteList: function () {
|
||||||
var loggingStyle = ReactDOM.findDOMNode(this.refs.loggingStyle).value.trim();
|
var loggingStyle = this.refs.loggingStyle.value.trim();
|
||||||
|
|
||||||
this.setState({loggingStyle: loggingStyle});
|
this.setState({loggingStyle: loggingStyle});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user