Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
chore:silence react warnings (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Aug 28, 2019
1 parent e0b5c42 commit 6139cbb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/input-text/InputText.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class InputSelect extends React.Component {
};
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({
value: nextProps.value,
});
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/screens/blocks/BlockCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BlockCard extends Component {
this.props.dispatch(Blocks.showBlock(this.props.blockNumber));
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.blockNumber != nextProps.blockNumber) {
this.props.dispatch(Blocks.showBlock(nextProps.blockNumber));
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/screens/blocks/BlockList.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class BlockList extends Component {
super(props);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// If the scroll position changed...
const latestRequested =
nextProps.blocks.requested[nextProps.core.latestBlock];
Expand Down Expand Up @@ -46,7 +46,7 @@ class BlockList extends Component {

render() {
return (
<div className="BlockList" ref="container">
<div className="BlockList">
{this.props.blocks.inView.map(block => {
return (
<MiniBlockCard
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/screens/contracts/ContractDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ContractDetails extends Component {
this.state = { project, contract };
}

componentWillMount() {
UNSAFE_componentWillMount() {
const contractCache = this.props.workspaces.current.contractCache;
const cache = contractCache[this.state.contract.address];
const transactions = cache.transactions.slice(
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/screens/logs/LogContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ class LogContainer extends Component {
return nextProps.logs.lines.length !== this.props.logs.lines.length;
}

componentWillUpdate() {
UNSAFE_componentWillUpdate() {
var pixelBuffer = 10;
var node = this.refs.LogItems;
var node = this.LogItems;
this.shouldScrollBottom =
node.scrollTop + node.offsetHeight >= node.scrollHeight - pixelBuffer;
}

componentDidUpdate() {
if (this.shouldScrollBottom) {
this.refs.LogItems.scrollTop = this.refs.LogItems.scrollHeight;
this.LogItems.scrollTop = this.LogItems.scrollHeight;
}
}

componentDidMount() {
this.refs.LogItems.scrollTop = this.refs.LogItems.scrollHeight;
this.LogItems.scrollTop = this.LogItems.scrollHeight;
}

render() {
return (
<div className="LogContainer" ref="LogContainer">
<ul ref="LogItems">
<div className="LogContainer">
<ul ref={el => (this.LogItems = el)}>
<Scrollbars
className="scrollBar"
renderThumbVertical={props => (
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/screens/title/TitleScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class TitleScreen extends Component {
}, 1000);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (
"global" in nextProps.config.settings &&
"firstRun" in nextProps.config.settings.global
) {
this.state.firstRun = nextProps.config.settings.global.firstRun;
this.setState({ firstRun: nextProps.config.settings.global.firstRun });
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/screens/transactions/RecentTransactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as Transactions from "../../../common/redux/transactions/actions";
import TxList from "./TxList";

class RecentTransactions extends Component {
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// If the scroll position changed...
if (
nextProps.appshell.scrollPosition != this.props.appshell.scrollPosition
Expand Down

0 comments on commit 6139cbb

Please sign in to comment.