initialCount is not defind for useReducer
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
Hi
Most programmers copy-paste the examples and play around with them until they learn how to use the API.
On the sample code given here the code does not work because the initialCount is not defined.
It should be fixed like this:
function init(initialCount) {
return {count: 0};
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the Hooks Reference lazy initialization example linked in the issue and inspect the sample around useReducer. Update the example so its initialCount reference is defined, then verify that the displayed sample is self-contained and works as documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100