Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Update stateful component example in README.md#247

Open
lexjacobs wants to merge 1 commit intomicrosoft:masterfrom
lexjacobs:patch-2
Open

Update stateful component example in README.md#247
lexjacobs wants to merge 1 commit intomicrosoft:masterfrom
lexjacobs:patch-2

Conversation

@lexjacobs
Copy link

@lexjacobs lexjacobs commented Dec 25, 2018

this.state = { currentEnthusiasm: props.enthusiasmLevel || 1 }; doesn't fill its intended purpose when the prop is falsy, such as 0.

The original form actually fails the enzyme tests defined in the next section.

`this.state = { currentEnthusiasm: props.enthusiasmLevel || 1 };` doesn't fill its intended purpose when the prop is falsy, such as `0`.
@Andrewnetwork
Copy link

Seconded. This fixed my issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants