1Simple example of react pure component
2
3import React from 'react';
4
5class PercentageStat extends React.PureComponent {
6
7 render() {
8 const { label, score = 0, total = Math.max(1, score) } = this.props;
9
10 return (
11 <div>
12 <h6>{ label }</h6>
13 <span>{ Math.round(score / total * 100) }%</span>
14 </div>
15 )
16 }
17}