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:
Ra100
2016-06-30 15:05:04 +02:00
parent 24cca3b236
commit 7d90992aac
2 changed files with 9 additions and 10 deletions

View File

@@ -1,7 +1,6 @@
/* global chrome */
var React = require('react');
var ReactDOM = require('react-dom');
var ReactCSSTransitionGroup = require('react-addons-css-transition-group');
var config = require('../config');
@@ -53,9 +52,9 @@ var Options = React.createClass({
loggingStyle: items.loggingStyle
});
ReactDOM.findDOMNode(that.refs.theme).value = items.theme;
ReactDOM.findDOMNode(that.refs.loggingType).value = items.loggingType;
ReactDOM.findDOMNode(that.refs.loggingStyle).value = items.loggingStyle;
that.refs.theme.value = items.theme;
that.refs.loggingType.value = items.loggingType;
that.refs.loggingStyle.value = items.loggingStyle;
});
},
@@ -68,9 +67,9 @@ var Options = React.createClass({
saveSettings: function () {
var that = this;
var theme = ReactDOM.findDOMNode(this.refs.theme).value.trim();
var loggingType = ReactDOM.findDOMNode(this.refs.loggingType).value.trim();
var loggingStyle = ReactDOM.findDOMNode(this.refs.loggingStyle).value.trim();
var theme = this.refs.theme.value.trim();
var loggingType = this.refs.loggingType.value.trim();
var loggingStyle = this.refs.loggingStyle.value.trim();
// Trimming blacklist and whitelist removes blank lines and spaces.
var blacklist = that.state.blacklist.trim();
var whitelist = that.state.whitelist.trim();
@@ -96,7 +95,7 @@ var Options = React.createClass({
},
_displayBlackOrWhiteList: function () {
var loggingStyle = ReactDOM.findDOMNode(this.refs.loggingStyle).value.trim();
var loggingStyle = this.refs.loggingStyle.value.trim();
this.setState({loggingStyle: loggingStyle});
},