microsoft / TypeScript-React-Starter

A starter template for TypeScript and React with a detailed README describing how to use the two together.
MIT License
11.09k stars 1.21k forks source link

The code of READEM.md has a bug #185

Open Tracis opened 6 years ago

Tracis commented 6 years ago

The part of Stateful components has a line:

this.state = { currentEnthusiasm: props.enthusiasmLevel || 1 };

When enthusiasmLevel is 0, it will be default set 1. So throw new Error will not work.

if (this.state.currentEnthusiasm <= 0) {
    throw new Error('You could be a little more enthusiastic. :D');
}
corbob commented 6 years ago

This also causes the tests to fail...