score:2

Accepted answer
import React, { Component } from 'react';

export default class Board extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <div className="board">{this.props.count}</div>
        );
    }
}

Board.propTypes = {
  count: (props, propName, componentName) => {  
    if (props[propName]) {
        let value = props[propName];
        if (typeof value === 'number') {
            if (value > 100) {
                return new Error("Value cannot be more than 100");
            }
        }
        else{
            return new Error('Count should be a number')
        }
    }
  }
}

score:2

static propTypes = { count: Board.validate }
static validate(props, propName, componentName) {  
  // ...
}

Related Query

More Query from same tag