Today, everyone is talking about Bitcoin, Ethereum, Ripple, and other cryptocurrencies. Let's create our own Crypto Coins Exchanger to learn how shouldComponentUpdate works.
Our exchanger will look like this:
- We'll sell entire coins. That means we won't trade with decimals; everything should be an integer, and each currency costs $10 dollars. Our code is simple, so let's take a look:
import React, { Component } from 'react';import './Coins.css';class Coins extends Component { constructor() { super(); // Initial state... this.state = { dollars: 0 }; } shouldComponentUpdate(props, ...