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

chore:silence react warnings #1412

Merged
merged 6 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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