diff --git a/README.md b/README.md index 0793532..1e1a2a2 100644 --- a/README.md +++ b/README.md @@ -280,7 +280,7 @@ interface State { class Hello extends React.Component { constructor(props: Props) { super(props); - this.state = { currentEnthusiasm: props.enthusiasmLevel || 1 }; + this.state = { currentEnthusiasm: props.enthusiasmLevel == null ? 1 : props.enthusiasmLevel }; } onIncrement = () => this.updateEnthusiasm(this.state.currentEnthusiasm + 1);