[Typo]: explanation of useMemo first-render return value, doesn't make logical sense
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
Summary
Inconsistent explaining on what useMemo returns on first render.
Page
https://react.dev/reference/react/useMemo#reference
Details
From article, in order:
On the initial render, useMemo returns the result of calling calculateValue with no arguments.
On the initial render, the value you’ll get from useMemo will be the result of calling your calculation.
The first sentence, to me does not make sense, as calculateValue is called with arguments, it's just that dependencies don't factor in yet on first render.
Or my bad sorry:)
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 useMemo reference page at the linked section and compare the two descriptions of the initial render. Confirm how the calculation is called and revise the inconsistent wording so it is logically accurate; done when the explanation no longer implies that arguments are omitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100