reactjs / reactjs/react.dev

Bad Example for "Examples of wrapping Effects in custom Hooks"

Open
#5,954 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

In example 2 of 3 of Wrapping Effects in Custom Hooks, the useEffect is called per render and isn't the same as before.

Screenshot 2023-04-23 at 9 01 01 PM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked React useEffect documentation page and inspect example 2 of 3 under “Wrapping Effects in Custom Hooks,” comparing it with the issue screenshot. Trace why the shown useEffect is called on every render, then update the example so it accurately demonstrates the intended custom-hook usage and verify the rendered documentation example.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.