From 69a717ca4192ff7c2cfde443239227fb68f2c6ec Mon Sep 17 00:00:00 2001 From: Alex Jacobs Date: Tue, 25 Dec 2018 00:13:39 -0800 Subject: [PATCH] Update README.md `this.state = { currentEnthusiasm: props.enthusiasmLevel || 1 };` doesn't fill its intended purpose when the prop is falsy, such as `0`. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0793532..90f9791 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 === undefined ? 1 : props.enthusiasmLevel }; } onIncrement = () => this.updateEnthusiasm(this.state.currentEnthusiasm + 1);