From 3028779158a2c2c519be121c995e4ff3afb1a940 Mon Sep 17 00:00:00 2001 From: David Dao Date: Tue, 27 Nov 2018 20:11:14 +0700 Subject: [PATCH] StatefulHello passes npm run test Allowing to set `0`, so `StatefulHello` component can pass the same tests as `Hello` component --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);